libp2p/protocols/kademlia/routing_table

Search:
Group by:
Source   Edit  

Procs

proc `$`(rt: RoutingTable): string {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc allKeys(bucket: Bucket): seq[Key] {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc allKeys(rtable: RoutingTable): seq[Key] {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc bucketIndex(rtable: RoutingTable; key: Key): int {....raises: [],
    tags: [RootEffect], forbids: [].}
Source   Edit  
proc findClosest(rtable: RoutingTable; targetId: Key; count: int): seq[Key] {.
    ...raises: [], tags: [RootEffect], forbids: [].}
Returns up to count nodes in the table with the smallest XOR distance to targetId. Source   Edit  
proc findClosestPeerIds(rtable: RoutingTable; targetId: Key; count: int): seq[
    PeerId] {....raises: [], tags: [RootEffect], forbids: [].}
Source   Edit  
proc insert(rtable: RoutingTable; nodeId: Key): bool {....raises: [],
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc insert(rtable: RoutingTable; peerId: PeerId): bool {....raises: [],
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc isStale(bucket: Bucket): bool {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc new(T: typedesc[RoutingTable]; selfId: Key;
         config: RoutingTableConfig = RoutingTableConfig.new();
         localNodeId: Opt[Key] = Opt.none(Key)): T:type
Source   Edit  
proc new(T: typedesc[RoutingTableConfig]; replication = DefaultReplication;
         hasher: Opt[XorDHasher] = NoneHasher;
         maxBuckets: int = DefaultMaxBuckets; selfIdPreHashed = false): T:type
Source   Edit  
proc oldestPeer(bucket: Bucket): (NodeEntry, int) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc randomKey(bucket: Bucket; rng: Rng): Opt[Key] {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc randomKeyInBucket(selfId: Key; bucketIndex: int; rng: Rng;
                       maxBuckets: int = DefaultMaxBuckets): Key {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc randomPeersClosestFirst(rtable: RoutingTable; rng: Rng; count: int;
                             maxPerBucket = high(int)): seq[Key] {....raises: [],
    tags: [], forbids: [].}
Returns up to count peers sampled randomly from the routing table's buckets, starting from the closest buckets (highest indices) and moving to farther buckets (lower indices). Source   Edit  
proc randomPeersClosestFirstPeerIds(rtable: RoutingTable; rng: Rng; count: int;
                                    maxPerBucket = high(int)): seq[PeerId] {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc updateRoutingTableMetrics(rtable: RoutingTable) {....raises: [], tags: [],
    forbids: [].}
Update routing table gauge metrics Source   Edit