Expand description
Main entry point of the sc-network crate.
There are two main structs in this module: NetworkWorker
and NetworkService
.
The NetworkWorker
is the network. Network is driven by NetworkWorker::run
future that
terminates only when all instances of the control handles NetworkService
were dropped.
The NetworkService
is merely a shared version of the NetworkWorker
. You can obtain an
Arc<NetworkService>
by calling NetworkWorker::service
.
The methods of the NetworkService
are implemented by sending a message over a channel,
which is then processed by NetworkWorker::next_action
.
Re-exports§
pub use behaviour::InboundFailure;
pub use behaviour::OutboundFailure;
pub use behaviour::ResponseFailure;
Modules§
Structs§
- Decoding
Error - An error during decoding of key material.
- Keypair
- Identity keypair of a node.
- Network
Service - Substrate network service. Handles network IO and manages connectivity.
- Network
Worker - Main network worker. Must be polled in order for the network to advance.
- Notification
Metrics - Notification metrics.
- Notification
Sender - A
NotificationSender
allows for sending notifications to a peer with a chosen protocol. - Notification
Sender Ready - Reserved slot in the notifications buffer, ready to accept data.
- Notifications
Sink - Sink connected directly to the node background task. Allows sending notifications to the peer.
- Public
Key - The public key of a node’s identity keypair.