-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
'peers' RPC command #78
Conversation
LGTM. @whyrusleeping should probably comment, given he knows that part of the codebase better. though its small enough we can merge if you want it in master tonight |
|
||
for _, p := range *n.PeerMap { | ||
addrs := make([]string, len(p.Addresses)) | ||
for i, addr := range p.Addresses { |
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.
this 'i' is shadowing 'i' on L22.
On 25, you can use the presently underscored variable as an outer i
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'd make them distinct too -- for pn, p := ...
and for an, addr := ...
So, to start this all off, (still need to read over things more to determine safety of certain calls), could you add a user facing command "ipfs peers" that allows the user to invoke this command directly? Another cool feature would be a 'format' flag that lets the user specify how the data gets output (json vs text vs ????) |
@@ -88,13 +89,15 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) { | |||
return nil, err | |||
} | |||
|
|||
peers = &peer.Map{} |
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.
you dont need to take a pointer to map types, theyre already psuedo reference types anyways
Re the |
@mappum excited! |
609a71b
to
5fafaa4
Compare
cd43433
to
8f1c12e
Compare
This PR will have to change with new cmds. @mappum i'll close it for now, reopen if it changes. |
gx: remove bbloom dep
Add Init Alternative allowing specification of ED25519 key
Add Init Alternative allowing specification of ED25519 key
Add Init Alternative allowing specification of ED25519 key
Add Init Alternative allowing specification of ED25519 key
This just adds a
peers
RPC command which outputs a list of the currently connected peers.Also includes a fix to
core
to populate the PeerMap, making the peer data accessible.