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 should be part of go-libp2p instead of go-ipfs #773

Closed
vasco-santos opened this issue Sep 25, 2018 · 5 comments
Closed

DHT should be part of go-libp2p instead of go-ipfs #773

vasco-santos opened this issue Sep 25, 2018 · 5 comments

Comments

@vasco-santos
Copy link
Member

Taking into account the objective of creating interop tests for libp2p, as well as for libp2p-kad-dht and my current focus on creating DHT interop tests on IPFS interop#36, I noticed that the DHT in JS land is a piece of js-libp2p, while in GO land, the DHT is used directly by go-ipfs, and not through go-libp2p go-ipfs/core/core.go#L514.

This does not feel right to me since the DHT is a really important part of libp2p and considering our focus on interop tests, as well as creating testbed scenarios, we must have the DHT available in libp2p.

I found a really old issue go-libp2p#56 for tackling this, and what happened was to remove the implementation of the DHT from go-ipfs to a specific module, but keeping its use directly on go-ipfs.

Is there anything blocking this?

cc @bigs @Stebalien @diasdavid

@Stebalien
Copy link
Member

It is a part of libp2p, it's just not a direct dependency of go-libp2p. go-libp2p is just a meta-package. IIRC, the issue was that go-libp2p-kad-dht depends on go-libp2p (for tests, IIRC). Our DHT needs to construct a host and all the logic for constructing a host lives in go-libp2p.

I'm not sure what the best solution here is that doesn't introduce a cyclic dependency. In other package managers, we could make the dht's tests a separate package but that's a bit difficult at the moment with gx.

@vasco-santos
Copy link
Member Author

vasco-santos commented Sep 25, 2018

Thanks for the explanation @Stebalien , I see your point.

That way, maybe the daemon can expose both go-libp2p and go-libp2p-kad-dht for allowing tests using the DHT, as well as to allow the DHT to be used through bindings from other languages. I don't know if you are already considering something like this

@Stebalien
Copy link
Member

Personally, I'd like to put the DHT in a separate daemon/process but we may punt on that till later. This is one of the reasons we may want to consider multiple daemons. The daemon we want for applications may look very different from the one we'll want for testing.

@daviddias
Copy link
Member

This issue was just helpful for understanding this decision

@aarshkshah1992 aarshkshah1992 transferred this issue from libp2p/go-libp2p Jan 17, 2020
@marten-seemann
Copy link
Contributor

The DHT is currently living in https://github.com/libp2p/go-libp2p-kad-dht, so this is resolved (?).

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

4 participants