Module protocol

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§

pub use protocol_version::ProtocolVersion;
pub use protocol_ping::ProtocolPing;
pub use protocol_address::ProtocolAddress;
pub use protocol_seed::ProtocolSeed;

Modules§

protocol_address
Protocol for address and get-address messages.
protocol_base
Base trait for implementing P2P protocols
protocol_generic
Generic protocol to receive specified structure messages.
protocol_jobs_manager
Manages the tasks for the network protocol.
protocol_ping
Protocol for ping-pong keepalive messages.
protocol_registry
Interface for registering arbitrary P2P protocols
protocol_seed
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_version
Protocol for version information handshake between nodes at the start of a connection. This is the first step when establishing a p2p conn.

Functions§

register_default_protocols
Register the default network protocols for a p2p instance.