# Packages
No description provided by the author
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.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
BootstrapPeers configures the bootstrapping nodes that we will connect to to seed and refresh our Routing Table if it becomes empty.
BootstrapPeersFunc configures the function that returns the bootstrapping nodes that we will connect to to seed and refresh our Routing Table if it becomes empty.
BucketSize configures the bucket size (k in the Kademlia paper) of the routing table.
Concurrency configures the number of concurrent requests (alpha in the Kademlia paper) for a given query path.
Datastore configures the DHT to use the specified datastore.
DisableAutoRefresh completely disables 'auto-refresh' on the DHT routing table.
DisableProviders disables storing and retrieving provider records.
DisableValues disables storing and retrieving value records (including public keys).
GetDefaultBootstrapPeerAddrInfos returns the peer.AddrInfos for the default bootstrap peers so we can use these for initializing the DHT by passing these to the BootstrapPeers(...) option.
MaxRecordAge specifies the maximum time that any node will hold onto a record ("PutValue record") from the time its received.
Mode configures which mode the DHT operates in (Client, Server, Auto).
NamespacedValidator adds a validator namespaced under `ns`.
New creates a new DHT with the specified host and options.
NewDHT creates a new DHT object with the given peer as the 'local' host.
NewDHTClient creates a new DHT object with the given peer as the 'local' host.
NewKeyKadID creates a KeyKadID from a string Kademlia ID.
NewLookupEvent creates a LookupEvent automatically converting the node libp2p Peer ID to a PeerKadID and the string Kademlia key to a KeyKadID.
NewLookupTerminateEvent creates a new lookup termination event with a given reason.
NewLookupUpdateEvent creates a new lookup update event, automatically converting the passed peer IDs to peer Kad IDs.
NewPeerKadID creates a PeerKadID from a libp2p Peer ID.
NewPeerKadIDSlice creates a slice of PeerKadID from the passed slice of libp2p Peer IDs.
NewRTPeerDiversityFilter constructs the `PeerIPGroupFilter` that will be used to configure the diversity filter for the Routing Table.
OptPeerKadID returns a pointer to a PeerKadID or nil if the passed Peer ID is it's default value.
PrivateQueryFilter doens't currently restrict which peers we are willing to query from the local DHT.
PrivateRoutingTableFilter allows a peer to be added to the routing table if the connections to that peer indicate that it is on a private network.
ProtocolExtension adds an application specific protocol to the DHT protocol.
ProtocolPrefix sets an application specific prefix to be attached to all DHT protocols.
ProviderStore sets the provider storage manager.
PublicQueryFilter returns true if the peer is suspected of being publicly accessible.
PublicRoutingTableFilter allows a peer to be added to the routing table if the connections to that peer indicate that it is on a public network.
PublishLookupEvent publishes a query event to the query event channel associated with the given context, if any.
QueryFilter sets a function that approves which peers may be dialed in a query.
Quorum is a DHT option that tells the DHT how many peers it needs to get values from before returning the best one.
RegisterForLookupEvents registers a lookup event channel with the given context.
Resiliency configures the number of peers closest to a target that must have responded in order for a given query path to complete.
RoutingTableFilter sets a function that approves which peers may be added to the routing table.
RoutingTableLatencyTolerance sets the maximum acceptable latency for peers in the routing table's cluster.
RoutingTablePeerDiversityFilter configures the implementation of the `PeerIPGroupFilter` that will be used to construct the diversity filter for the Routing Table.
RoutingTableRefreshPeriod sets the period for refreshing buckets in the routing table.
RoutingTableRefreshQueryTimeout sets the timeout for routing table refresh queries.
V1ProtocolOverride overrides the protocolID used for /kad/1.0.0 with another.
Validator configures the DHT to use the specified validator.
# Constants
DefaultPrefix is the application specific prefix attached to all DHT protocols by default.
LookupCancelled indicates that the lookup was aborted by the context.
LookupCompleted indicates that the lookup terminated successfully, reaching the Kademlia end condition.
LookupStarvation indicates that the lookup terminated due to lack of unqueried peers.
LookupStopped indicates that the lookup was aborted by the user's stopFn.
ModeAuto utilizes EvtLocalReachabilityChanged events sent over the event bus to dynamically switch the DHT between Client and Server modes based on network conditions.
ModeAutoServer operates in the same way as ModeAuto, but acts as a server when reachability is unknown.
ModeClient operates the DHT as a client only, it cannot respond to incoming queries.
ModeServer operates the DHT as a server, it can both send and respond to queries.
# Variables
DefaultBootstrapPeers is a set of public DHT bootstrap peers provided by libp2p.
DefaultProtocols spoken by the DHT.
ErrNoPeersQueried is returned when we failed to connect to any peers.
ErrReadTimeout is an error that occurs when no message is read within the timeout period.
LookupEventBufferSize is the number of events to buffer.
ProtocolDHT is the default DHT protocol.
# Structs
IpfsDHT is an implementation of Kademlia with S/Kademlia modifications.
KeyKadID contains the Kademlia key in string and binary form.
LookupEvent is emitted for every notable event that happens during a DHT lookup.
LookupTerminateEvent describes a lookup termination event.
LookupUpdateEvent describes a lookup state update event.
PeerKadID contains a libp2p Peer ID and a binary Kademlia ID.
# Type aliases
LookupTerminationReason captures reasons for terminating a lookup.
ModeOpt describes what mode the dht should operate in.
No description provided by the author
QueryFilterFunc is a filter applied when considering peers to dial when querying.
RouteTableFilterFunc is a filter applied when considering connections to keep in the local route table.