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

Finding peers #3686

Closed
iain17 opened this issue Feb 12, 2017 · 2 comments
Closed

Finding peers #3686

iain17 opened this issue Feb 12, 2017 · 2 comments

Comments

@iain17
Copy link

iain17 commented Feb 12, 2017

Version information:

go-ipfs version: 0.4.5-
Repo version: 5
System version: amd64/darwin
Golang version: go1.7.4

Type: Enhancement

Priority: Relatively Unimportant

Description:

I'm having trouble finding peers. I would love to find peers around a common name, hash or topic. Speaking to some people on the #ipfs IRC channel I understood that floodsub is interesting for me. However publishing data on a topic doesn't seem to reach anything outside my local ipfs instance?

I'm trying to extend the api example of whyrusleeping here so so that it automatically finds other peers, based on a common hash. I've tried using the networking DHT and had mixed results. I'm hoping that someone can point me into the right direction. Should I be using bitswap? or connecting to a swarm around a common hash be the right way to go about this?

My code is here: https://github.com/iain17/dht-hello/tree/libp2p
With the interesting part being: https://github.com/iain17/dht-hello/blob/libp2p/p2p/app.go#L76
A sort of successful version with DHT: https://github.com/iain17/dht-hello/blob/127335927223d688784eef18cf30288cd7ad8eef/p2p/app.go#L74

At least in the DHT version, I find peer ids. However, upon connecting it throws "protocol not supported".

Any Go examples where clients find each other automatically would be wonderful. I looked at length at the Orbit project and go-libp2p.

@whyrusleeping
Copy link
Member

@iain17 Using my service example is rather limited, All peers you talk to with that will have to be running code with that protocol code in it. This means you can't easily just dial up a given peer at a random new protocol.

If you're just looking for a method to find random new peers, you can query random dht keys (as you're doing in your dht example). If you want to find specific peers, one way would be to use the dht providers as a service discovery mechanism (discussed here: ipfs/notes#15)

@iain17
Copy link
Author

iain17 commented Feb 21, 2017

@whyrusleeping Thanks. Yeah this issue is probably a dup of ipfs/notes#15

Thanks for your reply.

@iain17 iain17 closed this as completed Feb 21, 2017
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

2 participants