Crate libp2p_kad
source ·Expand description
Kademlia protocol. Allows peer discovery, records store and records fetch.
Usage
Usage is done in the following steps:
-
Build a
KadSystemConfig
and aKadConnecConfig
object that contain the way you want the Kademlia protocol to behave. -
Create a swarm that upgrades incoming connections with the
KadConnecConfig
. -
Build a
KadSystem
from theKadSystemConfig
. This requires passing a closure that provides the Kademlia controller of a peer. -
You can perform queries using the
KadSystem
.
Re-exports
pub use self::kbucket::KBucketsPeerId;
pub use self::protocol::KadConnectionType;
Modules
Key-value storage, with a refresh and a time-to-live system.
Provides the
KadRequestMsg
and KadResponseMsg
enums of all the possible messages
transmitted with the Kademlia protocol, and the KademliaProtocolConfig
connection upgrade.Structs
Network behaviour that handles Kademlia.
Enums
Output event of the
Kademlia
behaviour.Traits
Trait allowing retreival of information necessary for the Kadmelia system to work.