-
Notifications
You must be signed in to change notification settings - Fork 40
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
I can not make browser pubsub example working - Uncaught (in promise) Error: PublishError.InsufficientPeers #70
Comments
I can confirm. Your screenshot says, you do not have any "topic peers". This means if you post a message to pubsub without peers you get the error "insufficient peers" In my case its the exact same problem. I am subscribing to the topic, but I don't get any topic peers. If I hit the "subscribe to topic" button about 5-10 times fast after another, I suddenly receive a sdp (WebRTC) error message:
SDP means probably that both peers (both browsers) cannot connect via WebRTC to each other. |
might be related. Mentioned fixes libp2p/js-libp2p#2179 Looks like it only works between chrome based browsers e.g. between Brave, Opera and Chrome. If you run the test inside the example directory like In the browser console in firefox now I receive a:
|
I tried without using webrtc and only the websocket address and I get the same error "insufficient peers" . It seems that when using circuit-relay with websocket produces this error . when using webrtc in chrome it works . The same applies when running in node and not the browser . |
I faced the same error. In my case, the reason was that Firefox does not normally support webrtc on the localhost domain. After changing the hostname to anything else the error had disappeared. |
I'm on Linux Mint 21.2 Cinnamon 5.15.0-87-generic #97-Ubuntu SMP Mon Oct 2 21:09:21 UTC 2023 x86_64 GNU/Linux
node V18.18.0
js-libp2p-examples@1.0.0 /home/smag/dev/js-libp2p-examples
└─┬ @libp2p/example-browser-pubsub@1.0.0 -> ./examples/js-libp2p-example-browser-pubsub
├── @chainsafe/libp2p-gossipsub@10.1.0
├── @chainsafe/libp2p-noise@13.0.2
├── @chainsafe/libp2p-yamux@5.0.0
├── @libp2p/webrtc@3.2.5
├── @libp2p/websockets@7.0.10
├── @multiformats/multiaddr@12.1.8
├── libp2p@0.46.16
├── test-ipfs-example@1.1.0
└── vite@4.5.0
The text was updated successfully, but these errors were encountered: