diff --git a/ant-bootstrap/src/initial_peers.rs b/ant-bootstrap/src/initial_peers.rs index 946c60c07f..16f71890b0 100644 --- a/ant-bootstrap/src/initial_peers.rs +++ b/ant-bootstrap/src/initial_peers.rs @@ -121,16 +121,10 @@ impl PeersArgs { let mut bootstrap_addresses = vec![]; - // Read from `ANT_PEERS` environment variable if present - if let Ok(addrs) = std::env::var(ANT_PEERS_ENV) { - for addr_str in addrs.split(',') { - if let Some(addr) = craft_valid_multiaddr_from_str(addr_str, false) { - info!("Adding addr from environment variable: {addr}"); - bootstrap_addresses.push(BootstrapAddr::new(addr)); - } else { - warn!("Invalid multiaddress format from environment variable: {addr_str}"); - } - } + // Read from ANT_PEERS environment variable if present + bootstrap_addresses.extend(Self::read_bootstrap_addr_from_env()); + + if !bootstrap_addresses.is_empty() { return Ok(bootstrap_addresses); } @@ -150,9 +144,6 @@ impl PeersArgs { } } - // Read from ANT_PEERS environment variable if present - bootstrap_addresses.extend(Self::read_bootstrap_addr_from_env()); - if let Some(count) = count { if bootstrap_addresses.len() >= count { bootstrap_addresses.sort_by_key(|addr| addr.failure_rate() as u64); diff --git a/autonomi/src/client/mod.rs b/autonomi/src/client/mod.rs index 154ac3a04f..3f9fb81b94 100644 --- a/autonomi/src/client/mod.rs +++ b/autonomi/src/client/mod.rs @@ -109,7 +109,7 @@ impl Client { let peers = if let Some(peers) = config.peers { peers } else { - match peers_args.get_addrs(None).await { + match peers_args.get_addrs(None, None).await { Ok(peers) => peers, Err(e) => return Err(e), }