-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: forest-cli net info #3292
Conversation
let info = net_info((), &config.client.rpc_token) | ||
.await | ||
.map_err(handle_rpc_err)?; | ||
println!("forest libp2p swarm info:"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could implement Display
for the NetInfoResult
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it but not sure if it's good practice to implement a multi-line Display
message, formatting a multi-line message with print macro could end up with messy result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with either approach.
src/chain_sync/chain_muxer.rs
Outdated
@@ -419,6 +419,10 @@ where | |||
metrics::LIBP2P_MESSAGE_TOTAL | |||
.with_label_values(&[metrics::values::PEER_DISCONNECTED]) | |||
.inc(); | |||
// Unset heavist tipset for unset peers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? what does it have to do with this subcommand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was using this to cross-check the correctness of the metrics, it's part of #3218 and I can convert it into a separate PR if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it in a separate PR and comment on it some more, then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Summary of changes
As part of #3218
Changes introduced in this pull request:
forest-cli net info
command that prints libp2p stats directly fromSwarm::network_info
APISample output:
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist