Skip to content
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

DHT Get Value not working because nodes aren’t found #569

Closed
govi218 opened this issue Apr 7, 2020 · 3 comments
Closed

DHT Get Value not working because nodes aren’t found #569

govi218 opened this issue Apr 7, 2020 · 3 comments

Comments

@govi218
Copy link

govi218 commented Apr 7, 2020

I have a 4 node setup: relay node, sender node, receiver node and storage node. Sender connects to storage through relay node and passes data through a stream, and the storage node calls IpfsDHT.PutValue() to store that data. Receiver connects to relay node and calls IpfsDHT.GetValue()using the same key as the sender (exchanged out of band). However, I keep getting a routing: not found error. Refreshing the DHT does not affect anything.
Further, calling IpfsDHT.FindPeer from the relay node on itself yields nothing (not even its own ID). However, the relay node’s Peerstore has the IDs of all nodes involved.
How can I make the IpfsDHT.GetValue() function to work?

@Stebalien
Copy link
Member

I assume you're using the latest release, 0.6.2? We've made some changes and are still working on updating the documentation and ironing out some kinks.

In the latest release, DHT nodes won't become DHT servers until they determine that they're directly reachable from the public internet. That way, unreachable nodes behind NATs don't end up harming the public DHT.

Obviously, this doesn't work well in a private network situation. The simple solution for now is to pass dht.Mode(dht.ModeServer) to dht.New(...) when you construct the DHT. We're working on a better solution so this should go back to working by default.

@Stebalien Stebalien pinned this issue Apr 7, 2020
iNDicat0r added a commit to iNDicat0r/go-libp2p-examples that referenced this issue Apr 10, 2020
Recent changes break the DHT peer discovery when testing on local and private nets.
libp2p/go-libp2p-kad-dht#569
@willscott
Copy link
Contributor

in #570, we added a dual DHT wrapper for the split-wan-lan DHT behavior that hopefully works well in general purpose IPFS use. See if using that wrapper also works for you

I can take a look at seeing if there's a good go-libp2p-examples I can add for the dual-DHT wrapper.

@Stebalien Stebalien mentioned this issue Apr 21, 2020
7 tasks
@willscott
Copy link
Contributor

Tracking remaining work in libp2p/go-libp2p-examples#156

@Stebalien Stebalien unpinned this issue May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants