go-libp2p-kad-dht
go-libp2p-kad-dht copied to clipboard
Libp2p DHT
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.
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:
- [ ] Rename the DHT: #337, #419.
- [ ] Change the constructor:
- [ ] No default validators (maybe /pk?).
- [ ] Server mode by default.
- [ ] Make the protocol name a mandatory argument.
- [ ] Remove the IPFS DHT bootstrappers.
- [ ] Introduce a new
ipfs/go-ipfs-dhtpackage in a new repo. We could also put anIPFSDHT 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 new package should have a simple
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.
cc @raulk.
- [ ] https://github.com/libp2p/go-libp2p-examples/issues/156 is also a good subtask for this epic