Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Content Discovery (Advertise/FindPeers) Finding 0 peers #171

Open
alabianca opened this issue May 12, 2020 · 2 comments
Open

Content Discovery (Advertise/FindPeers) Finding 0 peers #171

alabianca opened this issue May 12, 2020 · 2 comments

Comments

@alabianca
Copy link

alabianca commented May 12, 2020

Hi,
Thanks for all the examples. They help a lot. I am running into an issue where I am trying to run the chat-with-rendezvous examples on 2 machines.
Both machines connect to the bootstrap peers just fine and both advertise the meet me here rendezvous string. However, when using FindPeers I get back 0 peers. The example only works if i run both peers on the same machine or on the same network.

Some friends and I are trying to learn more about libp2p by building a dummy app that advertises file hashes via discovery.Advertise and find them using discovery.FindPeers . However, we run into the above issue as we sit behind NATs.
Once we do have the peer ID we know how to connect to each other using circuit-relay. Its just a matter of discovering the peer that advertises the hash which blocks us at the moment.

@alabianca alabianca changed the title Content Discovery (Advertise/FindPeers) Finding 0 peers same network different machines. Content Discovery (Advertise/FindPeers) Finding 0 peers May 12, 2020
@t-lin
Copy link

t-lin commented Jun 24, 2020

I ran into this issue a while ago and root-caused it to changes in the kad DHT package sometime after v0.5.0. The default mode of DHTs used to be "server", now the default is just a client (they can query, but not respond). The fix was to add the dht.Mode(dht.ModeServer) option as a parameter when calling dht.New().

@alinturbut
Copy link

@t-lin thanks, that solved our issue as well! the examples / documentation need to be updated!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants