Skip to content

Commit

Permalink
solana gossip now includes feature set information
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Feb 25, 2022
1 parent 5e0086c commit 7111918
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cli-output/src/cli_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,8 @@ pub struct CliGossipNode {
pub rpc_host: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub feature_set: Option<u32>,
}

impl CliGossipNode {
Expand All @@ -2463,6 +2465,7 @@ impl CliGossipNode {
tpu_port: info.tpu.map(|addr| addr.port()),
rpc_host: info.rpc.map(|addr| addr.to_string()),
version: info.version,
feature_set: info.feature_set,
}
}
}
Expand All @@ -2488,7 +2491,7 @@ impl fmt::Display for CliGossipNode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"{:15} | {:44} | {:6} | {:5} | {:21} | {}",
"{:15} | {:44} | {:6} | {:5} | {:21} | {:8}| {}",
unwrap_to_string_or_none(self.ip_address.as_ref()),
self.identity_label
.as_ref()
Expand All @@ -2497,6 +2500,7 @@ impl fmt::Display for CliGossipNode {
unwrap_to_string_or_none(self.tpu_port.as_ref()),
unwrap_to_string_or_none(self.rpc_host.as_ref()),
unwrap_to_string_or_default(self.version.as_ref(), "unknown"),
unwrap_to_string_or_default(self.feature_set.as_ref(), "unknown"),
)
}
}
Expand All @@ -2511,10 +2515,10 @@ impl fmt::Display for CliGossipNodes {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
writeln!(
f,
"IP Address | Node identifier \
| Gossip | TPU | RPC Address | Version\n\
"IP Address | Identity \
| Gossip | TPU | RPC Address | Version | Feature Set\n\
----------------+----------------------------------------------+\
--------+-------+-----------------------+----------------",
--------+-------+-----------------------+---------+----------------",
)?;
for node in self.0.iter() {
writeln!(f, "{}", node)?;
Expand Down

0 comments on commit 7111918

Please sign in to comment.