-
Notifications
You must be signed in to change notification settings - Fork 71
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(p2p): add command to show p2p status #837
Conversation
cmd/dymint/commands/show_p2p_info.go
Outdated
duration, err := strconv.ParseInt(status["Duration"].(string), 10, 64) | ||
if err != nil { | ||
fmt.Println("Error parsing connection duration:", err) | ||
} | ||
fmt.Printf("Peer %d Id:%s Multiaddress:%s Duration:%s\n", i, info["id"], peer["remote_ip"], time.Duration(duration)) |
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.
what unit is the duration in ?
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.
please clarify and comment
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.
im not sure what you mean. the units are shown in the duration displayed. i added comments in the code for clarification.
i also updated the code to order peers by oldest connection and get the id also from rpc.
} | ||
|
||
// ShowNodeIDCmd dumps node's ID to the standard output. | ||
var ShowP2PInfoCmd = &cobra.Command{ |
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.
if all it does is calling rpc.NetInfo
than the implementation is redundant
it should be implemented on the rollapp/RDK similar to
func getNodeStatus(clientCtx client.Context) (*coretypes.ResultStatus, error) {
node, err := clientCtx.GetNode()
if err != nil {
return &coretypes.ResultStatus{}, err
}
return node.Status(context.Background())
}
but just calling node.NetInfo
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.
got it. implemented in the rdk in dymensionxyz/dymension-rdk#420
closing pr, since logic has been moved to rdk in dymensionxyz/dymension-rdk#420 |
PR Standards
Opening a pull request should be able to meet the following requirements
Close #798
<-- Briefly describe the content of this pull request -->
For Author:
godoc
commentsFor Reviewer:
After reviewer approval: