Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add waku discovery network enr to bootstrapping nodes by default #88

Merged
merged 1 commit into from
Sep 28, 2023
Merged
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
1,055 changes: 526 additions & 529 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ panic = 'unwind'
opt-level = 3

[workspace.dependencies]
graphcast-sdk = "0.4.3"
graphcast-sdk = { git = "https://github.com/graphops/graphcast-sdk" }
2 changes: 1 addition & 1 deletion subgraph-radio/benches/gossips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn gossip_poi_bench(c: &mut Criterion) {
waku_port: None,
waku_node_key: None,
boot_node_addresses: vec![],
waku_log_level: None,
waku_log_level: "fatal".to_string(),
waku_addr: None,
discv5_enrs: None,
discv5_port: None,
Expand Down
10 changes: 7 additions & 3 deletions subgraph-radio/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ impl Config {
) -> Result<GraphcastAgentConfig, GraphcastAgentError> {
let wallet_key = self.wallet_input().unwrap().to_string();
let topics = self.radio_infrastructure().topics.clone();
let mut discv5_enrs = self.waku().discv5_enrs.clone().unwrap_or(vec![]);
// Discovery network
discv5_enrs.push("enr:-P-4QJI8tS1WTdIQxq_yIrD05oIIW1Xg-tm_qfP0CHfJGnp9dfr6ttQJmHwTNxGEl4Le8Q7YHcmi-kXTtphxFysS11oBgmlkgnY0gmlwhLymh5GKbXVsdGlhZGRyc7hgAC02KG5vZGUtMDEuZG8tYW1zMy53YWt1djIucHJvZC5zdGF0dXNpbS5uZXQGdl8ALzYobm9kZS0wMS5kby1hbXMzLndha3V2Mi5wcm9kLnN0YXR1c2ltLm5ldAYfQN4DiXNlY3AyNTZrMaEDbl1X_zJIw3EAJGtmHMVn4Z2xhpSoUaP5ElsHKCv7hlWDdGNwgnZfg3VkcIIjKIV3YWt1Mg8".to_string());

GraphcastAgentConfig::new(
wallet_key,
Expand All @@ -116,7 +119,7 @@ impl Config {
self.waku().waku_port.clone(),
self.waku().waku_addr.clone(),
self.waku().filter_protocol,
self.waku().discv5_enrs.clone(),
Some(discv5_enrs),
self.waku().discv5_port,
)
.await
Expand Down Expand Up @@ -521,9 +524,10 @@ pub struct Waku {
long,
value_name = "WAKU_LOG_LEVEL",
help = "Waku node logging configuration",
default_value = "fatal",
env = "WAKU_LOG_LEVEL"
)]
pub waku_log_level: Option<String>,
pub waku_log_level: String,
#[clap(
long,
value_name = "DISCV5_ENRS",
Expand Down Expand Up @@ -583,7 +587,7 @@ mod tests {
waku_port: None,
waku_node_key: None,
boot_node_addresses: vec![],
waku_log_level: None,
waku_log_level: "fatal".to_string(),
waku_addr: None,
discv5_enrs: None,
discv5_port: None,
Expand Down
6 changes: 0 additions & 6 deletions subgraph-radio/src/operator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ impl RadioOperator {
};
let notifier = Notifier::from_config(config);

GRAPHCAST_AGENT
.get()
.unwrap()
.register_handler()
.expect("Could not register handler");

RadioOperator {
config: config.clone(),
persisted_state,
Expand Down
2 changes: 1 addition & 1 deletion test-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ categories = [
]

[dependencies]
waku = { version = "0.1.1", package = "waku-bindings" }
waku = { version = "0.3.0", package = "waku-bindings" }
test-utils = { path = "../test-utils" }
graphcast-sdk = { workspace = true }
subgraph-radio = { path = "../subgraph-radio" }
Expand Down
2 changes: 1 addition & 1 deletion test-sender/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ categories = [
]

[dependencies]
waku = { version = "0.1.1", package = "waku-bindings" }
waku = { version = "0.3.0", package = "waku-bindings" }
graphcast-sdk = { workspace = true }
test-utils = { path = "../test-utils" }
subgraph-radio = { path = "../subgraph-radio" }
Expand Down
2 changes: 2 additions & 0 deletions test-sender/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ async fn start_sender(config: TestSenderConfig) {
store_retention_max_messages: None,
store_retention_max_seconds: None,
gossipsub_params: Some(gossipsub_params),
dns4_domain_name: None,
websocket_params: None,
};

let node_handle = waku_new(Some(node_config)).unwrap().start().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ categories = [
]

[dependencies]
waku = { version = "0.1.1", package = "waku-bindings" }
waku = { version = "0.3.0", package = "waku-bindings" }
graphcast-sdk = { workspace = true }
subgraph-radio = { path = "../subgraph-radio" }
tokio = { version = "1.1.1", features = ["full", "rt"] }
Expand Down
2 changes: 1 addition & 1 deletion test-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn test_config() -> Config {
waku_node_key: None,
waku_addr: None,
boot_node_addresses: vec![],
waku_log_level: None,
waku_log_level: "fatal".to_string(),
discv5_enrs: None,
discv5_port: None,
filter_protocol: None,
Expand Down
2 changes: 1 addition & 1 deletion test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub fn start_radio(config: &Config) -> Child {
.to_string(),
)
.arg("--waku-log-level")
.arg(config.waku().waku_log_level.as_deref().unwrap_or("None"))
.arg(config.waku().waku_log_level.clone())
.arg("--waku-port")
.arg(config.waku().waku_port.as_deref().unwrap_or("None"))
.arg("--log-level")
Expand Down
Loading