diff --git a/beacon_node/eth2_libp2p/src/peer_manager/client.rs b/beacon_node/eth2_libp2p/src/peer_manager/client.rs index a31fee493..ba2376c25 100644 --- a/beacon_node/eth2_libp2p/src/peer_manager/client.rs +++ b/beacon_node/eth2_libp2p/src/peer_manager/client.rs @@ -30,6 +30,8 @@ pub enum ClientKind { Teku, /// A Prysm node. Prysm, + /// A lodestar node. + Lodestar, /// An unknown client. Unknown, } @@ -84,6 +86,7 @@ impl std::fmt::Display for Client { "Prysm: version: {}, os_version: {}", self.version, self.os_version ), + ClientKind::Lodestar => write!(f, "Lodestar: version: {}", self.version), ClientKind::Unknown => { if let Some(agent_string) = &self.agent_string { write!(f, "Unknown: {}", agent_string) @@ -157,6 +160,18 @@ fn client_from_agent_version(agent_version: &str) -> (ClientKind, String, String } (kind, version, os_version) } + Some("js-libp2p") => { + let kind = ClientKind::Lodestar; + let mut version = String::from("unknown"); + let mut os_version = version.clone(); + if let Some(agent_version) = agent_split.next() { + version = agent_version.into(); + if let Some(agent_os_version) = agent_split.next() { + os_version = agent_os_version.into(); + } + } + (kind, version, os_version) + } _ => { let unknown = String::from("unknown"); (ClientKind::Unknown, unknown.clone(), unknown)