How do one interrogate a libp2p node for the protocols it supports #2674
Replies: 2 comments
-
Reading the documentation here: https://docs.libp2p.io/concepts/protocols/
It seems there is no way to ask a node for the protocol it supports, and protocol negotiation is basically trial and error: dial a node with a protocol, if it ends the connection, then that protocol is not supported. Is this a clear representation of what obtains? Or there are other ways to know the protocol a node supports? |
Beta Was this translation helpful? Give feedback.
-
The identify protocol transmits a list of protocol names supported by the peer (in addition to the purposes documented at the link), so it is a great idea to run that protocol on all libp2p nodes. The default settings include an initial delay for sending the identify info, but you can set that to zero to make the handshake quicker. |
Beta Was this translation helpful? Give feedback.
-
As said in the title, how do one interrogate a libp2p node for the protocols it supports?
Lets say I have a PeerId or a Multadr I want to communicate with, what requests do I need to make to negotiate the protocol it supports?
Beta Was this translation helpful? Give feedback.
All reactions