js-libp2p-gossipsub icon indicating copy to clipboard operation
js-libp2p-gossipsub copied to clipboard

Newly connecting nodes don't interconnect

Open TimDaub opened this issue 2 years ago • 4 comments

  • I have 1 bootstrap node and then I launch 3 newly connecting nodes that are all joining via the bootstrap node.
  • I subscribe all nodes to a topic name
  • When I publish messages under the topic, all nodes receive it too
  • However, when I make the bootstrap node go down, sadly now all other nodes have lost connectivity as they were seemingly arranged as a hub and spokes
  • My expectation would have been that connectivity among nodes is quickly established. Am I configuring something falsely?

TimDaub avatar Feb 24 '23 23:02 TimDaub

I got this working by implementing js-libp2p-pubsub-peer-discovery but this was far from obvious for me given the docs.

TimDaub avatar Feb 25 '23 15:02 TimDaub

@TimDaub you wouldn't happen to have a working example of this? I have the exact same problem as you describe, and I hav tried just about anything to get this to work, but it does not.

here is the code for my bootstrap node and remote peer(s), respectively

  • https://github.com/EdenEver/paima-2-paima/blob/master/bootstrap-server/index.ts#L12
  • https://github.com/EdenEver/paima-2-paima/blob/master/electron-client/src/renderer/src/components/libp2p/createLibp2p.ts#L26

GGAlanSmithee avatar May 08 '24 15:05 GGAlanSmithee

check this file https://github.com/attestate/kiwistand/blob/main/src/config.mjs

TimDaub avatar May 08 '24 15:05 TimDaub

Thanks @TimDaub I finally got this working by adding js-libp2p-pubsub-peer-discovery to all peers (not just the bootstrap peer)

GGAlanSmithee avatar May 09 '24 08:05 GGAlanSmithee

glad you got it working

wemeetagain avatar Oct 09 '24 18:10 wemeetagain