Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ members = [

"validator_client",
"validator_client/slashing_protection",

"watch",
]

[patch]
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/http_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ slot_clock = { path = "../../common/slot_clock" }
eth2_ssz = "0.4.0"
bs58 = "0.4.0"
futures = "0.3.8"
sensitive_url = { path = "../../common/sensitive_url" }

[dev-dependencies]
store = { path = "../store" }
environment = { path = "../../lighthouse/environment" }
tree_hash = "0.4.0"
sensitive_url = { path = "../../common/sensitive_url" }

[[test]]
name = "bn_http_api_tests"
Expand Down
1 change: 1 addition & 0 deletions beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mod metrics;
mod proposer_duties;
mod state_id;
mod sync_committees;
pub mod test_utils;
mod validator_inclusion;
mod version;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::{Config, Context};
use beacon_chain::{
test_utils::{BeaconChainHarness, EphemeralHarnessType},
BeaconChain, BeaconChainTypes,
};
use eth2::{BeaconNodeHttpClient, Timeouts};
use http_api::{Config, Context};
use lighthouse_network::{
discv5::enr::{CombinedKey, EnrBuilder},
libp2p::{core::connection::ConnectionId, swarm::NetworkBehaviour},
Expand Down Expand Up @@ -146,7 +146,7 @@ pub async fn create_api_server<T: BeaconChainTypes>(
// It's not really interesting why this triggered, just that it happened.
let _ = shutdown_rx.await;
};
let (listening_socket, server) = http_api::serve(ctx, server_shutdown).unwrap();
let (listening_socket, server) = crate::serve(ctx, server_shutdown).unwrap();

ApiServer {
server,
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/http_api/tests/fork_tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Tests for API behaviour across fork boundaries.
use crate::common::*;
use beacon_chain::{test_utils::RelativeSyncCommittee, StateSkipConfig};
use eth2::types::{StateId, SyncSubcommittee};
use http_api::test_utils::*;
use types::{ChainSpec, Epoch, EthSpec, MinimalEthSpec, Slot};

type E = MinimalEthSpec;
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/http_api/tests/interactive_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Generic tests that make use of the (newer) `InteractiveApiTester`
use crate::common::*;
use eth2::types::DepositContractData;
use http_api::test_utils::*;
use types::{EthSpec, MainnetEthSpec};

type E = MainnetEthSpec;
Expand Down
1 change: 0 additions & 1 deletion beacon_node/http_api/tests/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![cfg(not(debug_assertions))] // Tests are too slow in debug.
#![recursion_limit = "256"]

pub mod common;
pub mod fork_tests;
pub mod interactive_tests;
pub mod tests;
2 changes: 1 addition & 1 deletion beacon_node/http_api/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::common::{create_api_server, ApiServer};
use beacon_chain::test_utils::RelativeSyncCommittee;
use beacon_chain::{
test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy, EphemeralHarnessType},
Expand All @@ -13,6 +12,7 @@ use eth2::{
};
use futures::stream::{Stream, StreamExt};
use futures::FutureExt;
use http_api::test_utils::{create_api_server, ApiServer};
use lighthouse_network::{Enr, EnrExt, PeerId};
use network::NetworkMessage;
use sensitive_url::SensitiveUrl;
Expand Down
2 changes: 1 addition & 1 deletion common/eth2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use lighthouse_network::PeerId;
pub use reqwest;
use reqwest::{IntoUrl, RequestBuilder, Response};
pub use reqwest::{StatusCode, Url};
use sensitive_url::SensitiveUrl;
pub use sensitive_url::{SensitiveError, SensitiveUrl};
use serde::{de::DeserializeOwned, Serialize};
use std::convert::TryFrom;
use std::fmt;
Expand Down
35 changes: 35 additions & 0 deletions watch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "watch"
version = "0.1.0"
edition = "2018"

[lib]
name = "watch"
path = "src/lib.rs"

[[bin]]
name = "watch"
path = "src/main.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio-postgres = "0.7.5"
clap = "2.33.3"
log = "0.4.14"
env_logger = "0.9.0"
types = { path = "../consensus/types" }
eth2 = { path = "../common/eth2" }
tokio = { version = "1.14.0", features = ["time"] }
warp_utils = { path = "../common/warp_utils" }
warp = "0.3.2"
serde = "1.0.116"
serde_json = "1.0.58"
reqwest = { version = "0.11.0", features = ["json","stream"] }
url = "2.2.2"
rand = "0.7.3"

[dev-dependencies]
http_api = { path = "../beacon_node/http_api" }
beacon_chain = { path = "../beacon_node/beacon_chain" }
network = { path = "../beacon_node/network" }
30 changes: 30 additions & 0 deletions watch/postgres_docker_compose/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "3"

services:
postgres:
image: postgres:12.3-alpine
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
volumes:
- postgres:/var/lib/postgresql/data
ports:
- 5432:5432

pgadmin:
image: dpage/pgadmin4:4.23
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: password
PGADMIN_LISTEN_PORT: 80
ports:
- 15432:80
volumes:
- pgadmin:/var/lib/pgadmin
depends_on:
- postgres

volumes:
postgres:
pgadmin:
Loading