[][src]Crate libp2p_kad

Kademlia protocol. Allows peer discovery, records store and records fetch.

Usage

Usage is done in the following steps:

  • Build a KadSystemConfig and a KadConnecConfig 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 the KadSystemConfig. 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

handler
kbucket

A k-buckets table allows one to store a value identified by keys, ordered by their distance to a reference key passed to the constructor.

protocol

Provides the KadRequestMsg and KadResponseMsg enums of all the possible messages transmitted with the Kademlia protocol, and the KademliaProtocolConfig connection upgrade.

Structs

Kademlia

Network behaviour that handles Kademlia.

Enums

KademliaOut

Output event of the Kademlia behaviour.