Nesting DHTs
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.
@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 Which issue is this for ?
@aschmahmann Which issue is this for ?
@aarshkshah1992 I filled in some text above, it's for #616