GithubHelp home page GithubHelp logo

Comments (2)

upperwal avatar upperwal commented on July 23, 2024

@stefanhans So everyone trying this code by default are using meet me here as the rendezvousString.

So every time you run this code a new peer is started and it will announce itself (using Provide) to the bootstrap node with rendezvous point meet me here. But what happens once you disconnect?

Your address is still registered in the bootstrap node at that rendezvous point (till the time it expires and dht is forced to remove it) and anyone looking for new peers to connect (using FindProviders) will get your address. Now bootstrap peers don't know if these address or peers are still alive. Now, when you try to connect to them you get dial attempt failed: error.

Now, this is not your peers fault instead it's the bootstrap peer giving you dead peers. I don't think libp2p has any method which lets you remove peers from the bootstrap peer's list. It should be the bootstrap peer who should ping a remote node just to check if it is alive or dead and act accordingly. RFC: rendezvous is a more sophisticated rendezvous protocol which is better than the existing dht hack.

You might also notice that if you run a peer (let's say A) and announce yourself to the dht and now start another peer (say B) which queries the bootstrap peer for new addresses. All peers received by peer B are dead and none of the address corresponds to peer A. This happens because bootstrap peer returns a random subset of the peers registered with it.

So, it would be better to not use meet me here instead use something unique and start two peers with the same rendezvousString. For meet me here to work you need more number of alive peers than the dead ones.

from go-libp2p-examples.

stefanhans avatar stefanhans commented on July 23, 2024

Hi @upperwal,

sounds reasonable 😀 thx

I ended up with using a UUID as rendezvous string. Still not always getting all peers connected in the prototype of mine.

Maybe SWIM(++) protocol from Hashicorp is worth a try.

Cheers, Stefan

from go-libp2p-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.