Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

86
Views
libp2p: Using Chat over WAN

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!