Readonly
[initProtected
dbProtected
keyProtected
loggerReadonly
nodeProtected
nodeProtected
nodeProtected
nodeProtected
nodeReadonly
nodeBit size of the NodeIds This equals the number of buckets
Protected
spaceDerive the bucket index of the k-buckets from the new NodeId
The bucket key is the string encoded version of bucket index
that preserves lexicographic order
Gets a bucket The bucket's node IDs is sorted lexicographically by default Alternatively you can acquire them sorted by lastUpdated timestamp or by distance to the own NodeId
Optional
tran: DBTransactionOptional
tran: DBTransactionOptional
tran: DBTransactionGets all buckets.
Buckets are always sorted by NodeBucketIndex
first
Then secondly by the sort
parameter
The order
parameter applies to both, for example possible sorts:
NodeBucketIndex asc, NodeID asc
NodeBucketIndex desc, NodeId desc
NodeBucketIndex asc, distance asc
NodeBucketIndex desc, distance desc
NodeBucketIndex asc, lastUpdated asc
NodeBucketIndex desc, lastUpdated desc
Optional
tran: DBTransactionFinds the set of nodes (of size k) known by the current node (i.e. in its buckets' database) that have the smallest distance to the target node (i.e. are closest to the target node). i.e. FIND_NODE RPC from Kademlia spec
Used by the RPC service.
the node ID to find other nodes closest to it
the number of the closest nodes to return (by default, returns according to the maximum number of nodes per bucket)
Optional
tran: DBTransactiona mapping containing exactly k nodeIds -> nodeAddresses (unless the current node has less than k nodes in all of its buckets, in which case it returns all nodes it has knowledge of)
Get all nodes.
Nodes are always sorted by NodeBucketIndex
first
Then secondly by the node IDs
The order
parameter applies to both, for example possible sorts:
NodeBucketIndex asc, NodeID asc
NodeBucketIndex desc, NodeId desc
Optional
tran: DBTransactionOptional
tran: DBTransactionProtected
setSets a bucket meta property This is protected because users cannot directly manipulate bucket meta
Will add a node to the node graph and increment the bucket count. If the node already existed it will be updated.
NodeId to add to the NodeGraph
Address information to add
Optional
tran: DBTransactionProtected
setupSets up the space key
The space string is suffixed to the buckets
and meta
sublevels
This is used to allow swapping of sublevels when remapping buckets
during this.refreshBuckets
Optional
tran: DBTransactionStatic
createGenerated using TypeDoc
Max number of nodes in each k-bucket