darkfi::net

Module protocol

Source
Expand description

Defines the networking protocol used at each stage in a connection. Consists of a series of messages that are sent across the network at the different connection stages.

When a node connects to a network for the first time, it must follow a seed protocol, which provides it with a list of network hosts to connect to. To establish a connection to another node, nodes must send version and version acknowledgement messages. During a connection, nodes continually get address and get-address messages to inform each other about what nodes are on the network. Nodes also send out a ping and pong message which keeps the network from shutting down.

Protocol submodule also implements a jobs manager that handles the asynchronous execution of the protocols.

Re-exports§

Modules§

  • Protocol for address and get-address messages.
  • Base trait for implementing P2P protocols
  • Generic protocol to receive specified structure messages.
  • Manages the tasks for the network protocol.
  • Protocol for ping-pong keepalive messages.
  • Interface for registering arbitrary P2P protocols
  • Seed server protocol. Seed server is used when connecting to the network for the first time. Returns a list of peers that nodes can connect to.
  • Protocol for version information handshake between nodes at the start of a connection. This is the first step when establishing a p2p conn.

Functions§