go-libp2p-kad-dht icon indicating copy to clipboard operation
go-libp2p-kad-dht copied to clipboard

Rename `IpfsDHT` to `Kad` or something else

Open hsanjuan opened this issue 6 years ago • 4 comments

While IPFS uses this DHT, this DHT does not need IPFS for anything.

hsanjuan avatar May 20 '19 16:05 hsanjuan

I think the same as you, and so i've made a PR for this issue.

KristenPire avatar May 21 '19 12:05 KristenPire

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)

gpestana avatar May 21 '19 14:05 gpestana

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.

  1. The protocol ID is here and listed as /ipfs/kad/1.0.0
  2. 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

aschmahmann avatar Sep 04 '19 18:09 aschmahmann

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.

anacrolix avatar Sep 04 '19 22:09 anacrolix