Package dual provides an implementaiton of a split or "dual" dht, where two parallel instances are maintained for the global internet and the local LAN respectively.
LanExtension is used to differentiate local protocol requests from those on the WAN DHT.
DHT implements the routing interface to provide two concrete DHT implementationts for use in IPFS that are used to support both global network users and disjoint LAN usecases.
New creates a new DualDHT instance. Options provided are forwarded on to the two concrete IpfsDHT internal constructions, modulo additional options used by the Dual DHT to enforce the LAN-vs-WAN distinction. Note: query or routing table functional options provided as arguments to this function will be overriden by this constructor.
Bootstrap allows callers to hint to the routing system to get into a Boostrapped state and remain there.
Close closes the DHT context.
FindPeer searches for a peer with given ID Note: with signed peer records, we can change this to short circuit once either DHT returns.
FindProvidersAsync searches for peers who are able to provide a given key
GetPublicKey returns the public key for the given peer.
GetRoutingTableDiversityStats fetches the Routing Table Diversity Stats.
GetValue searches for the value corresponding to given Key.
Provide adds the given cid to the content routing system.
PutValue adds value corresponding to given Key.
SearchValue searches for better values from this value
WANActive returns true when the WAN DHT is active (has peers).
Option is an option used to configure the Dual DHT.
DHTOption applies the given DHT options to both the WAN and the LAN DHTs.
LanDHTOption applies the given DHT options to the LAN DHT.
WanDHTOption applies the given DHT options to the WAN DHT.