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

Nesting DHTs

Open aschmahmann opened this issue 5 years ago • 3 comments

This is an attempt at #616.

The basic idea is to utilize DHTs where it is assumed that DHT A is a subset of DHT B and therefore be able to start a query in DHT A and finish it in DHT B without needing to restart the query.

While the bare bones of doing this for GetClosestPeers is quite straightforward, unfortunately it's a bit of a pain to implement this for all of the Router interface functions (e.g. FindProviders, PutValue, etc.). Very much a WIP right now, that would obviously be much easier if all the routing interfaces where taken care of by #584.

aschmahmann avatar Apr 30 '20 18:04 aschmahmann

@willscott if you rewind a commit everything looks much cleaner (it was in a separate package and all the grossness related to the transfer protocol disappears). The recent grossness was added in order to be able to run as a server in the inner DHT, but be a client on the outer DHT.

After talking with @Stebalien earlier today we decided that it was reasonable to insist that any inner DHT server would also be an outer DHT server.

I'll ping you when the next draft is done, it'll look much better.

aschmahmann avatar May 01 '20 05:05 aschmahmann

@aschmahmann Which issue is this for ?

aarshkshah1992 avatar May 01 '20 08:05 aarshkshah1992

@aschmahmann Which issue is this for ?

@aarshkshah1992 I filled in some text above, it's for #616

aschmahmann avatar May 01 '20 13:05 aschmahmann