Skip to content

Commit

Permalink
chore(network): write network information to stdout (#2034)
Browse files Browse the repository at this point in the history
This allows finding mm2 ports in stdout
  • Loading branch information
onur-ozkan authored Dec 14, 2023
1 parent 1755d57 commit 6d7d05f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mm2src/mm2_p2p/src/behaviours/atomicdex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@ fn start_gossipsub(
let noise_config = noise::Config::new(&local_key).expect("Signing libp2p-noise static DH keypair failed.");

let network_info = node_type.to_network_info();
info!("Network information: {:?}", network_info);

let transport = match network_info {
NetworkInfo::InMemory => build_memory_transport(noise_config),
NetworkInfo::Distributed { .. } => build_dns_ws_transport(noise_config, node_type.wss_certs()),
Expand Down
4 changes: 2 additions & 2 deletions mm2src/mm2_p2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ lazy_static! {
static ref SECP_SIGN: Secp256k1<SignOnly> = Secp256k1::signing_only();
}

#[derive(Clone, Copy)]
#[derive(Clone, Copy, Debug)]
pub enum NetworkInfo {
/// The in-memory network.
InMemory,
Expand All @@ -53,7 +53,7 @@ impl NetworkInfo {
pub fn in_memory(&self) -> bool { matches!(self, NetworkInfo::InMemory) }
}

#[derive(Clone, Copy)]
#[derive(Clone, Copy, Debug)]
pub struct NetworkPorts {
pub tcp: u16,
pub wss: u16,
Expand Down

0 comments on commit 6d7d05f

Please sign in to comment.