New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find self on bootstrap #147
Comments
|
I would like to work on this issue, since the project I am working on depends on it. |
Take our own PeerID, call It'll result in the same peers as the ones we'd write IPNS records to.
This is already being done and is dubbed "random walk". Here we generate random PeerIDs and call |
FYI, we only do one random walk as far as I can tell. |
|
@lgierth I tried that but I get a |
|
@florianlenz Yes. That's happening because, the first time you call FindPeer, none of the nodes actually know where to find your peer. Therefore, they'll return a "not found" error; you should ignore it. However, by trying to find your own peer, you'll end up connecting to the peers responsible for remembering your routing information which will implicitly (unfortunately) give them this information. |
|
@Stebalien I tried to find my own peer but it didn't help. I also tried to put / get a value to / from the DHT with the same error. 17 / 20 reject the dial when I put a value in the DHT. Is it a requirement that the value needs to be put to 20 of my closer peers or something that is nice to have? It would be great to have a few examples like in the go-libp2p repo. I would add them but I am failing to get something that works running. |
|
If i am getting it right, any peer, let's say Now, if
If the above is correct, we can try to update (insert) the @Stebalien let me know if this is correct or not. |
20 of the peers closest to the key you're trying to use, yes. This is an issue that @whyrusleeping is currently tackling. The problem is that GetClosestPeers returns a list of 20 peers closest to the key you're trying to put but it doesn't check if you can actually connect to those peers (and PutValue requires that all of those connections succeed).
Are you now able to actually connect to the other peers in your cluster (is peer discovery working properly)? |
|
The point here is not to actually find our own peer info in the DHT, it's to connect to the nodes responsible for remembering our peer info (so they can learn our peer info and answer future FindPeer requests).
The opposite. The first time A calls Note: If our routing table is empty, we'll always get an error. That's why connecting to some well known bootstrap nodes is an important first step. |
It works when calling |
|
Got it. Just making sure I had diagnosed that issue correctly. |
|
@Stebalien I see. Understood now. Thanks. |
This ensures that our neighbors learn about us so that other peers on the network *looking* for us can actually find us. Also: * Remove dead, racy code. * Set independent timeouts per bootstrap query. fixes #147
Stebalien commentedMay 5, 2018
We need to find ourself in the DHT to properly bootstrap the routing table. Finding random IDs will connect us to the rest of the DHT but we need to find ourself to:
This is kind of critical for proper DHT functionality. Actually, in addition to finding our own peer, I wonder if we should be trying to find a key in each bucket (or some sampling thereof)?
The text was updated successfully, but these errors were encountered: