Optional connectionOptional dnsOptional logger?: LoggerOptional mdnsOptional nodesOptional refreshOptional refreshOptional retryReadonly [initProtected checkReadonly checkProtected concurrencyReadonly connectionReadonly connectionTimeout for finding a connection via MDNS
Protected connectionUsed to track locks for authentication failure and acquiring connections
Protected dbProtected dnsProtected gcReadonly gcProtected gestaltProtected keyProtected loggerProtected mdnsProtected mdnsProtected nodeProtected nodeProtected pendingReadonly refreshReadonly refreshProtected refreshReadonly refreshReadonly retryInterval used to reestablish connections to maintain network health. Will trigger a refreshBucket for bucket 255 if it is missing connections. Will always trigger a findNode(this.keyRing.getNodeId()).
Protected sigchainReadonly syncProtected taskReadonly tasksFor usage with withF, to acquire a connection This unique acquire function structure of returning the ResourceAcquire itself is such that we can pass targetNodeId as a parameter (as opposed to an acquire function with no parameters).
Id of target node to communicate with
ResourceAcquire Resource API for use in with contexts
Protected addOptional tran: DBTransactionCall this function upon receiving a "claim node request" notification from another node.
Optional tran: DBTransactionOptional ctx: Partial<ContextTimedInput>Will attempt to find a node within the network using a hybrid strategy of attempting signalled connections, direct connections and checking MDNS.
Will attempt to fix regardless of existing connection.
Optional concurrencyOptional connectionOptional connectionOptional limit?: numberOptional ctx: Partial<ContextTimedInput>Will try to make a connection to the node using direct connections only
NodeId of the target to find.
shared nodeConnectionQueue helper class.
Optional connectionConnectTimeoutTime: numbertimeout time for each individual connection.
Optional ctx: Partial<ContextTimedInput>Will query MDNS for local nodes and attempt a connection.
NodeId of the target to find.
Optional ctx: Partial<ContextTimedInput>Will try to make a connection to the node using hole punched connections only
NodeId of the target to find.
shared nodeConnectionQueue helper class.
Optional connectionConnectTimeoutTime: numbertimeout time for each individual connection.
Optional ctx: Partial<ContextTimedInput>Protected garbageGets the specified bucket from the NodeGraph
Optional tran: DBTransactionOptional tran: DBTransactionOptional tran: DBTransactionProtected handleOptional tran: DBTransactionWill attempt to establish connection using findNode or use existing connection.
Will return true if connection was established or already exists, false otherwise.
Optional ctx: Partial<ContextTimedInput>Will attempt to make a direct connection without ICE. This will only succeed due to these conditions
Protected queueKademlia refresh bucket operation. It generates a random node ID within the range of a bucket and does a lookup for that node in the network. This will cause the network to update its node graph information.
Optional connectionConnectTimeoutTime: numberOptional ctx: Partial<ContextTimed>Connects to the target node, and retrieves its sigchain data. Verifies and returns the decoded chain as ChainData. Note: this will drop any unverifiable claims. For node1 -> node2 claims, the verification process also involves connecting to node2 to verify the claim (to retrieve its signing public key).
Adds a node to the node graph. This assumes that you have already authenticated the node
Updates the node if the node already exists
This operation is blocking by default - set block to false to make it non-blocking
ID of the node we wish to add
Expected address of the node we want to add
Optional block: booleanWhen true it will wait for any garbage collection to finish before returning.
Optional force: booleanFlag for if we want to add the node without authenticating or if the bucket is full. This will drop the oldest node in favor of the new.
Optional connectionConnectTimeoutTime: numberTimeout for each ping operation during garbage collection.
Optional tran: DBTransactionOptional ctx: Partial<ContextTimed>Protected setupGCTaskProtected setupProtected stopPerform an initial database synchronisation: get k of the closest nodes
from each seed node and add them to this database
Establish a connection to each node before adding it
By default this operation is blocking, set block to false to make it
From the spec: To join the network, a node u must have a contact to an already participating node w. u inserts w into the appropriate k-bucket. u then performs a node lookup for its own node ID. Finally, u refreshes all k-buckets further away than its closest neighbor. During the refreshes, u both populates its own k-buckets and inserts itself into other nodes’ k-buckets as necessary.
So this will do 3 steps
Optional connectionConnectTimeoutTime: numberOptional blocking: booleanOptional ctx: Partial<ContextTimedInput>Protected syncRemoves a node from the NodeGraph
Perform some function on another node over the network with a connection. Will either retrieve an existing connection, or create a new one if it doesn't exist. For use with normal arrow function
Id of target node to communicate with
Function to handle communication
Perform some function on another node over the network with a connection. Will either retrieve an existing connection, or create a new one if it doesn't exist. for use with a generator function
Id of target node to communicate with
Generator function to handle communication
Generated using TypeDoc
Time used to establish
NodeConnection