Newly connecting nodes don't interconnect
- 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?
I got this working by implementing js-libp2p-pubsub-peer-discovery but this was far from obvious for me given the docs.
@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
check this file https://github.com/attestate/kiwistand/blob/main/src/config.mjs
Thanks @TimDaub I finally got this working by adding js-libp2p-pubsub-peer-discovery to all peers (not just the bootstrap peer)
glad you got it working