Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: take boot peers only from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Atanasievski committed Nov 27, 2023
1 parent e361475 commit cdc74cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 1 addition & 5 deletions crates/topos/src/components/node/services/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ pub(crate) fn spawn_tce_process(
let tce_params = ReliableBroadcastParams::new(validators.len());

let tce_config = TceConfiguration {
boot_peers: genesis
.boot_peers(Some(topos_p2p::constants::TCE_BOOTNODE_PORT))
.into_iter()
.chain(config.parse_boot_peers())
.collect::<Vec<_>>(),
boot_peers: config.parse_boot_peers(),
validators,
auth_key: keys.network.map(AuthKey::PrivateKey),
signing_key: keys.validator.map(AuthKey::PrivateKey),
Expand Down
7 changes: 3 additions & 4 deletions crates/topos/src/config/tce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub struct TceConfig {
/// Storage database path, if not set RAM storage is used
#[serde(default = "default_db_path")]
pub db_path: PathBuf,
/// Array of extra boot nodes to connect to
pub extra_boot_peers: Option<String>,
/// Boot peers for the p2p network
pub boot_peers: String,
/// Ip for the p2p Multiaddr
pub tce_ext_host: Option<String>,
/// Port for the p2p Multiaddr
Expand Down Expand Up @@ -80,9 +80,8 @@ const fn default_metrics_api_addr() -> SocketAddr {

impl TceConfig {
pub fn parse_boot_peers(&self) -> Vec<(PeerId, Multiaddr)> {
self.extra_boot_peers
self.boot_peers
.clone()
.unwrap_or_default()
.split(&[',', ' '])
.map(|s| s.to_string())
.collect::<Vec<String>>()
Expand Down

0 comments on commit cdc74cd

Please sign in to comment.