libp2p-hs-0.1.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

Network.LibP2P.DHT.Types

Description

Core types for the Kademlia DHT.

Defines the DHT keyspace (256-bit SHA-256 keys), routing table entry structure, and protocol constants (k=20, alpha=10).

Synopsis

Documentation

newtype DHTKey Source #

256-bit key in the DHT keyspace (always exactly 32 bytes, SHA-256 output).

Constructors

DHTKey ByteString 

Instances

Instances details
Show DHTKey Source # 
Instance details

Defined in Network.LibP2P.DHT.Types

Eq DHTKey Source # 
Instance details

Defined in Network.LibP2P.DHT.Types

Methods

(==) :: DHTKey -> DHTKey -> Bool #

(/=) :: DHTKey -> DHTKey -> Bool #

Ord DHTKey Source # 
Instance details

Defined in Network.LibP2P.DHT.Types

data BucketEntry Source #

A single entry in a k-bucket.

Constructors

BucketEntry 

Fields

Instances

Instances details
Show BucketEntry Source # 
Instance details

Defined in Network.LibP2P.DHT.Types

Eq BucketEntry Source # 
Instance details

Defined in Network.LibP2P.DHT.Types

data InsertResult Source #

Result of attempting to insert a peer into the routing table.

Constructors

Inserted

Peer was added to the bucket

Updated

Existing peer was moved to tail (most recently seen)

BucketFull !PeerId

Bucket is full; returns LRS peer ID for pinging

Instances

Instances details
Show InsertResult Source # 
Instance details

Defined in Network.LibP2P.DHT.Types

Eq InsertResult Source # 
Instance details

Defined in Network.LibP2P.DHT.Types

kValue :: Int Source #

Replication parameter: each k-bucket holds up to k peers.

alphaValue :: Int Source #

Concurrency parameter for iterative lookups.

numBuckets :: Int Source #

Number of buckets (one per bit of the 256-bit keyspace).