Closed tuphan-dn closed 2 months ago
Here is how I create the libp2p
const swarm = await createLibp2p({
start: false,
peerId: peer,
addresses: {
listen: [`/ip4/0.0.0.0/tcp/${config.PORT}`],
},
transports: [tcp()],
streamMuxers: [yamux()],
connectionEncryption: [noise()],
peerDiscovery: bootstrap({
list: config.BOOTSTRAP_NODES,
}),
services: {
identify: identify(),
identifyPush: identifyPush(),
kad: kadDHT({
clientMode: false,
}),
pubsub: gossipsub(),
autoNat: autoNAT(),
},
})
await swarm.services.kad.setMode('server')
await swarm.start()
I realize that node:dns
resolved my domain as ipv6
so I need to change /dns/...
to /dns6/...
, then it worked perfectly.
thanks so much for reporting and coming back with the fix for your scenario. super helpful for future folks.
I can connect to my bootstrap node if I add
/ip4/37.16.3.238/tcp/8080/p2p/12D3KooWKYkngptku6WmyYJgMKL6uHbxAuqhZ98u7Q67TFL2yF1p
into the bootstrap list. However, if I replace it to/dns/mpc-node-ts.fly.dev/tcp/8080/p2p/12D3KooWKYkngptku6WmyYJgMKL6uHbxAuqhZ98u7Q67TFL2yF1p
, it's impossible to connect the bootstrap node.Version: libp2p@^1.5.0, @libp2p/bootstrap@^10.0.22, @libp2p/tcp@^9.0.24
Platform: Ubuntu for bootstrap node and MacOS for the dialers
Subsystem: @libp2p/tcp
Severity:
High
Description:
I built a libp2p js bootstrap and deployed it to fly.io (with dedicated ipv4 of course). The thing is that I can connect to the bootstrap server with
ipv4
multiladdr format but thedns
multiaddr one.Steps to reproduce the error:
I have tried to turn on debug mode and got errors like this. Hope it helpful