Currently, the DHT in this package is the "IPFS" DHT.
It's called IpfsDHT.
It's protocol starts with /ipfs.
It requires the IPFS DHT validators.
It defaults to a special "auto" mode where nodes won't join the DHT until they're publicly reachable.
These are all requirements for the IPFS DHT, but not requirements for DHTs in general. Worse, the IPFS DHT is actually a dual DHT at this point because dht.New will return a semi-broken DHT that will refuse to work on private/localhost networks.
[ ] Introduce a new ipfs/go-ipfs-dht package in a new repo. We could also put an IPFS DHT sub-package in this repo, but it's probably cleaner if that lives in the IPFS repo.
This new package should have a simple New() function that takes very few options.
This way, users trying to build libp2p apps can explicitly choose which DHT they want to join and how they want to configure their network.
Currently, the DHT in this package is the "IPFS" DHT.
These are all requirements for the IPFS DHT, but not requirements for DHTs in general. Worse, the IPFS DHT is actually a dual DHT at this point because
dht.New
will return a semi-broken DHT that will refuse to work on private/localhost networks.For motivation, see: https://github.com/libp2p/go-libp2p-kad-dht/issues/569, https://github.com/libp2p/go-libp2p-kad-dht/issues/564, https://github.com/libp2p/go-libp2p-kad-dht/issues/561.
We should:
ipfs/go-ipfs-dht
package in a new repo. We could also put anIPFS
DHT sub-package in this repo, but it's probably cleaner if that lives in the IPFS repo.New()
function that takes very few options.This way, users trying to build libp2p apps can explicitly choose which DHT they want to join and how they want to configure their network.