Skip to content

Commit

Permalink
feat: (wip) add bootstrap nodes to config
Browse files Browse the repository at this point in the history
  • Loading branch information
mriise committed Jul 13, 2023
1 parent 7376c05 commit c76158d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions homestar-runtime/fixtures/settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ process_collector_interval = 10
[node.network]
events_buffer_len = 1000
websocket_port = 9999
bootstrap_addresses = ["/ip4/127.0.0.1/tcp/9998/ws/"]
5 changes: 5 additions & 0 deletions homestar-runtime/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ pub struct Network {
pub(crate) workflow_quorum: usize,
/// Pubkey setup configuration
pub(crate) keypair_config: PubkeyConfig,
/// Multiaddrs of the bootstrap nodes to connect to on startup
pub(crate) bootstrap_addresses: Vec<String>,
}

/// Database-related settings for a homestar node.
Expand Down Expand Up @@ -173,6 +175,7 @@ impl Default for Network {
websocket_capacity: 100,
workflow_quorum: 3,
keypair_config: PubkeyConfig::Random,
bootstrap_addresses: Vec::new(),
}
}
}
Expand Down Expand Up @@ -323,6 +326,8 @@ mod test {
default_modded_settings.network.events_buffer_len = 1000;
default_modded_settings.network.websocket_port = 9999;
default_modded_settings.shutdown_timeout = Duration::from_secs(20);
default_modded_settings.network.bootstrap_addresses =
vec!["/ip4/127.0.0.1/tcp/9998/ws/".into()];
assert_eq!(settings.node(), &default_modded_settings);
}

Expand Down

0 comments on commit c76158d

Please sign in to comment.