-
Notifications
You must be signed in to change notification settings - Fork 448
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 dialBest to the API #376
Comments
Sounds like a good improvement to me 👍 Should this just be an option on the |
We could support an array of protocols, but in these type of APIs I usually prefer to be more specific. The naming would not suit greatly receiving an array. Unless we add an option for |
dialProtocol accepts an array of protocols |
Type: Feature
Severity: N/A
Description:
There are use cases where we want to leverage libp2p to dial other peers using a specific protocol, but fallback to another one if that peer does not support the initial attempt. With the current API we need to do a cascade of dials, in order to do this, while libp2p could offer this in its API.
One example of this is in the Gossipsub implementation ChainSafe/gossipsub-js#34, where we intend to fallback to floodsubs if the peer does not support gossipsub.
We should have a utility to handle multi protocol negotiation, receiving a list of protocols and trying to dial by its order. An example could be:
This was discussed with @jacobheun in the Gossipsub PR
The text was updated successfully, but these errors were encountered: