go-libp2p-kad-dht
go-libp2p-kad-dht copied to clipboard
Rename `IpfsDHT` to `Kad` or something else
While IPFS uses this DHT, this DHT does not need IPFS for anything.
I think the same as you, and so i've made a PR for this issue.
I remember the naming has been kept for backwards compatibility, so you probably want to keep an alias too (cross comment to the PR #338). @anacrolix opened a PR to solve this not too long ago, but the merge got postponed. The discussion shows why (https://github.com/libp2p/go-libp2p-kad-dht/pull/223)
I disagree with this idea given the current way this library is set up. However, if we were prepared to make a couple changes I'd be all for it.
- The protocol ID is here and listed as
/ipfs/kad/1.0.0 - There is special handling for the IPFS use case of Provider records instead of just Get/Put.
- Provider records could just be special handlers on Get/Put that deal with Key-MultiValue instead of Key-Value
- Key-MultiValue could have separate Get/Put that are not restricted to provider records
A cleaner DHT interface can be ripped out from IpfsDHT, and IpfsDHT made to wrap it, conforming the expectations asserted at https://github.com/libp2p/go-libp2p-kad-dht/blob/a12e621d84028a4e0f165da8e2ca6be4f5af0502/dht.go#L73-L81.