Expand description
functionality of a libp2p network node
Re-exportsΒ§
pub use self::config::DEFAULT_REPLICATION_FACTOR;pub use self::config::GossipConfig;pub use self::config::NetworkNodeConfig;pub use self::config::NetworkNodeConfigBuilder;pub use self::config::NetworkNodeConfigBuilderError;pub use self::config::RequestResponseConfig;pub use self::handle::NetworkNodeHandle;pub use self::handle::NetworkNodeReceiver;pub use self::handle::spawn_network_node;
ModulesΒ§
- config π
- configuration for the libp2p network (e.g. how it should be built)
- handle π
- libp2p network handle allows for control over the libp2p network
StructsΒ§
- Network
Node - Network definition
ConstantsΒ§
- ESTABLISHED_
LIMIT - Wrapped num of connections
- ESTABLISHED_
LIMIT_ UNWR - Number of connections to a single peer before logging an error
- MAX_
GOSSIP_ MSG_ SIZE - Maximum size of a message
- NO_
INBOUND_ πCONNECTION_ GRACE_ PERIOD - How long to wait for the first inbound connection.
FunctionsΒ§
- direct_
message_ πprotocol - Resolve the direct-message stream protocol for the given network discriminator.
- gossipsub_
prefix π - Resolve the gossipsub
protocol_id_prefixfor the given network discriminator.Nonereturns the mainnet value (the libp2p default). - identify_
protocol π - Resolve the identify protocol string for the given network discriminator.
- kad_
protocol π - Resolve the kademlia stream protocol for the given network discriminator.
- mainnet_
direct_ πmessage_ protocol - mainnet_
gossipsub_ πprefix - Mainnet libp2p protocol identifiers. The snapshot tests below lock these down so a
change that would partition mainnet (e.g. a stray
protocol_id_prefixcall) is caught.Nonefor gossipsub means βdo not callprotocol_id_prefixβ β libp2pβs defaults (/meshsub/1.1.0and/meshsub/1.0.0) are then used. - mainnet_
identify_ πprotocol - mainnet_
kad_ πprotocol - resolve_
put_ πquorum - should_
keep_ πpeer - A peerβs network is identifiable only by its advertised kademlia
StreamProtocol.
Type AliasesΒ§
- Swarm
Task Handle - Join handle for the spawned swarm event-loop task.