Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

89
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda