generated from libp2p/js-libp2p-example-fork-go-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hello everyone,
I am currently testing the DHT
discovery example file. I created a simple bootstrap node.
When launching 4 instances of 1-dht.js
file, they are able to make connection to the bootstrap node only, they can't connect to other nodes.
Do you think this behavior is okay?
Here is my bootstrap node code :
import { createLibp2p } from 'libp2p'
import { tcp } from '@libp2p/tcp'
import { noise } from '@chainsafe/libp2p-noise'
import { kadDHT } from '@libp2p/kad-dht'
import { identify } from '@libp2p/identify'
import { yamux } from '@chainsafe/libp2p-yamux'
const node = await createLibp2p({
addresses: {
listen: [
'/ip4/0.0.0.0/tcp/2000',
'/ip4/0.0.0.0/tcp/2001/ws'
]
},
transports: [
tcp()
],
streamMuxers: [
yamux()
],
connectionEncrypters: [
noise()
],
services: {
identify: identify(),
dht: kadDHT({
kBucketSize: 20,
clientMode: false // Whether to run the WAN DHT in client or server mode (default: client mode)
})
}
})
node.start();
console.log('PeerID: ', node.peerId.toString())
console.log('Multiaddrs: ', node.getMultiaddrs())
Thank you.
Metadata
Metadata
Assignees
Labels
No labels