Skip to content
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

Store connection direction for peers #5443

Closed
andrewheadricke opened this issue Sep 8, 2018 · 4 comments
Closed

Store connection direction for peers #5443

andrewheadricke opened this issue Sep 8, 2018 · 4 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature topic/commands Topic commands

Comments

@andrewheadricke
Copy link

I would like to see in ipfs swarm peers or even ipfs swarm peers -v the direction of connection for each peer. I basically want to know which peers connected to me, and which peers I have initiated a connection to.

I am trying to more closely manage my list of peers and this information would be very useful.

I'm guessing this would need to be implemented at the libp2p level?

@Stebalien
Copy link
Member

We now actually store this. Internally, you can call Stat() on a connection to get information like direction (well, at the moment, that's just about all you can get). We should definitely expose this.

@Stebalien Stebalien added kind/enhancement A net-new feature or improvement to an existing feature topic/commands Topic commands labels Sep 11, 2018
@overbool
Copy link
Contributor

Hey @Stebalien, can I try to solve this?

@Stebalien
Copy link
Member

Go ahead.

@overbool
Copy link
Contributor

overbool commented Sep 13, 2018

Hey @Stebalien, I add the direction of connection behind the multiaddr, when i use ipfs swarm peers -v. like the follow:

/ip4/158.69.53.41/tcp/4001/ipfs/Qm... n/a outbound
/ip4/159.89.147.117/tcp/4001/ipfs/Qm... n/a outbound
/ip4/162.252.217.94/tcp/4001/ipfs/Qm... n/a outbound
/ip4/163.172.89.219/tcp/4001/ipfs/Qm... 239.373985ms outbound
  /ipfs/kad/1.0.0
/ip4/165.227.15.228/tcp/4001/ipfs/Qm... n/a outbound
  /ipfs/bitswap/1.1.0
  /ipfs/kad/1.0.0

What do you think of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature topic/commands Topic commands
Projects
None yet
Development

No branches or pull requests

3 participants