koi_net.components.handshaker

Classes

Handshaker(log, cache, identity, ...)

Handles handshaking with other nodes.

class koi_net.components.handshaker.Handshaker(log, cache, identity, event_queue, config, graph)[source]

Bases: object

Handles handshaking with other nodes.

Parameters:
cache: Cache
config: BaseNodeConfig
event_queue: EventQueue
graph: NetworkGraph
handshake_with(target)[source]

Initiates a handshake with target node.

Pushes successive FORGET and NEW events to target node to reset the target’s cache in case it already knew this node.

Parameters:

target (KoiNetNode)

identity: NodeIdentity
log: Logger
start()[source]

Attempts handshake with first contact on startup.

Handshake occurs if first contact is set in the config, the first contact is not already known to this node, and this node does not already have incoming edges with node providers.