-
Notifications
You must be signed in to change notification settings - Fork 473
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
libp2p pubsub room failing to find peers #239
Comments
I have an update on this. When one of the instances is ipfs, it works fine. But when both instances are libp2p instances, it doesn't work. Anybody has any idea why? |
Libp2p doesn't currently automatically handle dialing to peers that are discovered. This works with an ipfs node because ipfs is listening to the 'peer:discovery' event on the node and triggering dials to each peer it finds. While your nodes might be setup to the same room, they're not connected yet, so pubsub won't work. The current pubsub example uses MulticastDNS for discovery but the idea is the same, https://github.com/libp2p/js-libp2p/blob/master/examples/pubsub/1.js#L65, you'll just need to change |
That worked. Thank you so much. |
Increases default inactivity timeout to 5 minutes. closes libp2p#239
## [6.0.9](libp2p/js-libp2p-tcp@v6.0.8...v6.0.9) (2023-01-17) ### Bug Fixes * increase default socket close timeout ([libp2p#242](libp2p/js-libp2p-tcp#242)) ([a64ba41](libp2p/js-libp2p-tcp@a64ba41)), closes [libp2p#239](libp2p/js-libp2p-tcp#239) ### Trivial Changes * replace err-code with CodeError ([libp2p#240](libp2p/js-libp2p-tcp#240)) ([5c44562](libp2p/js-libp2p-tcp@5c44562)), closes [js-libp2p#1269](libp2p#1269)
Version: libp2p 0.23.1
libp2p-websocket-star 0.8.1
Node js 10.0
Platform: 64-bit (Windows 10).
Type: Bug (Maybe)
Severity: High
Description: I'm trying to create a libp2p pubsub room. I have two instances (in same machine) joined the same room but can't find each other. I've set a time interval to check the number of peers in the room but it's 0 always.
Here's the code:
The text was updated successfully, but these errors were encountered: