I do have a question regarding libp2p. Lately, I've been playing around with the library and found it quite interesting. I was able to communicate using relay nodes together with bootstrap nodes and thought I can make the next step using this example https://github.com/libp2p/js-libp2p-examples/tree/master/chat/nodejs/06-Pubsub
I adjusted the example to not use mdns for peer discovery since I wanted to connect via WAN to another peer that I hosted on a different PC using a mobile hotspot. This is my node configuration:
const libp2p = await Libp2p.create({
addresses: {
listen: [
'/ip4/0.0.0.0/tcp/0',
'/ip4/0.0.0.0/tcp/0/ws',
'/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star',
'/dns4/wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star'
]
},
modules: {
transport: [ TCP, Websockets, WebRTCStar ],
streamMuxer: [ Mplex ],
connEncryption: [ NOISE ],
peerDiscovery: [ Bootstrap ],
dht: KadDHT
// TODO: set pubsub
},
config: {
transport : {
[WebRTCStar.prototype[Symbol.toStringTag]]: {
wrtc
}
},
peerDiscovery: {
bootstrap: {
list: [
'/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt'
],
interval: 60e3,
}
},
dht: {
enabled: true,
randomWalk: {
enabled: true
}
}
}
})
I did play around with a lot of options from here: https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md but that did not help either.
Both nodes run identical code and can easily reach each other if they connect to the bootstrap servers using the same internet connection.
Has anyone experienced this kind of problem and can point me in the right direction?
Best thank you all for taking the time to read this