You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have a listener and dialer .js files that both use bootstrap list, that list has one address which belongs to another locally running node.
now the listener is connected to the local bootstrap node ... and when I run the dialer it also connects to the bootstrap, but can't find the listener to open connect to it and open a chat stream in the terminal.
it works with mDNS, but I want to do it using bootstrap, can somebody please help me understand what's missing?
this is the node creation in all three files
constnode=awaitcreateLibp2p({addresses: {listen: ['/ip4/0.0.0.0/tcp/0']},transports: [tcp()],streamMuxers: [yamux()],connectionEncrypters: [noise()],peerDiscovery: [bootstrap({list: bootstrappers// <-- I run the bootstrap locally, take its address and adjust the list to only have this address. then I run listener and dialer respectively })],services: {kadDHT: kadDHT({clientMode: true,protocol: '/ipfs/lan/kad/1.0.0',peerInfoMapper: removePublicAddressesMapper,validators: {[prefix]: async(key,value)=>{// do nothing, it's valid}},selectors: {[prefix]: (key,records)=>{return0}}}),identify: identify(),identifyPush: identifyPush(),ping: ping()},config: {dht: {// dht must be enabledenabled: true}}})
What I am trying to do is to somehow in the dialer find the listener and connect to it:
dialerNode.addEventListener('peer:discovery',async(evt)=>{constbootstrapPeerInfo=evt.detailconsole.log('Discovered:',bootstrapPeerInfo.id.toString())// from this peer (local bootstrap) find the listener which is already connected to this peer// connect to it using chat protocol})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I have a listener and dialer .js files that both use bootstrap list, that list has one address which belongs to another locally running node.
now the listener is connected to the local bootstrap node ... and when I run the dialer it also connects to the bootstrap, but can't find the listener to open connect to it and open a chat stream in the terminal.
it works with mDNS, but I want to do it using bootstrap, can somebody please help me understand what's missing?
this is the node creation in all three files
What I am trying to do is to somehow in the dialer find the listener and connect to it:
Thanks in advance :)
Beta Was this translation helpful? Give feedback.
All reactions