-
Notifications
You must be signed in to change notification settings - Fork 105
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
Gossip pubsub error, PublishError.InsufficientPeers
#233
Comments
This error happens when there are no peers listening on the You can check the peers subscribed to your topic with |
Hi @achingbrain, thank for your answer. I've just tried the demo from the @chainsafe/libp2p-gossipsub. I followed your suggestion and connect two nodes directly, it's start working as expected. Then I'm start to boot up two nodes without direct connect. It took me 15 minutes but these two nodes can't discover each other. Here is the multi addresses of my 1st node.
|
@chiro-hiro you may want to check out the recent example I put together for lan discovery: ipfs-examples/helia-examples#136 You will likely want something like this: helia.libp2p.services.pubsub.addEventListener('subscription-change', (evt) => {
if (helia.libp2p.services.pubsub.getSubscribers(pubSubTopic).length !== 0) {
// we're subscribed, and so is another node, so we can publish
helia.libp2p.services.pubsub?.publish(pubSubTopic, new TextEncoder().encode('wut-CID'))
}
}) |
I'm using the latest version of
helia@1.3.12
, I have this example code it wasn't work for me even there are several peers are connected. Am I do anything wrong?.The text was updated successfully, but these errors were encountered: