-
Notifications
You must be signed in to change notification settings - Fork 442
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
Triggering protocol once identify is done #908
Comments
Hello @D4nte libp2p.peerStore.on('change:protocols', ({ peerId, protocols}) => {
if (protocols.includes('/foo/1.0.0') { }
}) I believe this solves your solution. Please let me know |
Indeed, I missed this one. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Type: Question/Feature
Severity: Medium
Description:
When Alice connects to a peer that support protocol
/foo/1.0.0
, Alice wants to automatically initiate the message request for said protocol.Alice dials Bob, once done, Alice triggers the identify protocol with Bob.
Until the identify protocol is done, Alice does not know what protocol Bob implements.
On Alice side, there is no event emitted once the identify protocol is done.
All we can do is check that Alice's
peerStore
now contains Bob's protocols.I would like to propose emitting an event
peer:identify
once the identify protocol is done and the peer's protocols are now.Please let me know your thought, am I missing a more obvious solution to my issue?
The text was updated successfully, but these errors were encountered: