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

Add protocols to identity when adding a new handler #42

Closed
RangerMauve opened this issue Feb 3, 2018 · 1 comment
Closed

Add protocols to identity when adding a new handler #42

RangerMauve opened this issue Feb 3, 2018 · 1 comment

Comments

@RangerMauve
Copy link

As per the discussion in #32, there is a need for nodes to know what protocols their peers support so that modules (like pubsub, etc) can know whether they should dial into a protocol before they actually attempt this.

The identify protobuf already supports a repeated string field called protocols which I assume was made for this purpose.

I propose that we add a couple of lines of code to the various libp2p implementations in order to start adding protocols to the local PeerInfo of a node in order to have it passed on when a peer attempts to connect to them.

In the future, we will likely need to add extensions to the Identify protocol in order to allow peers to receive updates when a node gains or loses a protocol. (Not sure if there's something like this for multiaddrs already).

With that said, the following needs to be done to facilitate this:

  • [ ] Modify js-libp2p-swarm to add the protocol to their PeerInfo object whenever a new handler is added
  • [ ] Modify go-libp2p to add the protocol to their PeerInfo object whenever a new StreamHandler is set
  • [ ] Make sure the identify protocols of both implementations properly pass the protocols
  • [ ] Make a protocol that waits for the identity service to finish before trying to connect

Hopefully this is something the community wants to have and will be useful for coordinating between nodes with vastly different capabilities and versions in the future.

@mxinden
Copy link
Member

mxinden commented Apr 1, 2021

I propose that we add a couple of lines of code to the various libp2p implementations in order to start adding protocols to the local PeerInfo of a node in order to have it passed on when a peer attempts to connect to them.

This is happening today.

In the future, we will likely need to add extensions to the Identify protocol in order to allow peers to receive updates when a node gains or loses a protocol. (Not sure if there's something like this for multiaddrs already).

This can be done today via identify/push.

I am closing here as most things have either been tackled, are implementation specific or are tracked in other issues, e.g. #32. Feel free to comment here in case I am missing something.

@mxinden mxinden closed this as completed Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants