probe-lab / go-kademlia

Generic Go Kademlia implementation
Other
17 stars 4 forks source link

Define Public IPFS DHT Interface #24

Closed iand closed 10 months ago

iand commented 1 year ago

Description

Define a clean interface to the dht with an implementation that configures a scheduler, starts it and keeps it running to service requests. This is the interface that Kubo would use when integrated.

See if https://hackmd.io/@iandavis/SyjmgYkrh provides anything useful here.

guillaumemichel commented 1 year ago

The goal of this repository is to provide generic building blocks to build any Kademlia DHT.

Defining the Public IPFS DHT Interface should probably happen in https://github.com/ipfs/boxo

iand commented 1 year ago

I think the IPFS DHT interface is orthogonal to this issue. I was thinking that we need to define how to instantiate the scheduler and keep it running. I'm not sure that is a client responsibility.

guillaumemichel commented 1 year ago

I would argue that it is the client responsibility to manage the scheduler. However the IPFS DHT should have a standard interface setting up the scheduler. This part should live in https://github.com/ipfs/boxo, and it is where all interactions between boxo and Kademlia (including multi thread support) should be defined. IPFS builders should use the IPFS DHT Interface, they don't have to know anything about scheduling or single/multithread.

kubo and boxo are multithread, but a single thread implementation would interact differently with the scheduler of the go-kademlia implementation generally.