[][src]Crate libp2p_core

Transport, protocol upgrade and swarm systems of libp2p.




The main concepts of libp2p are:

  • The Topology trait is implemented for types that hold the layout of a network. When other components need the network layout to operate, they are passed an instance of a Topology.

High-level APIs vs low-level APIs

This crate provides two sets of APIs:

  • The high-level APIs include the concepts of Swarm, ProtocolsHandler, NetworkBehaviour and Topology.


pub extern crate multiaddr;
pub use self::muxing::StreamMuxer;
pub use self::protocols_handler::ProtocolsHandler;
pub use self::protocols_handler::ProtocolsHandlerEvent;
pub use self::swarm::Swarm;
pub use self::transport::Transport;
pub use self::upgrade::InboundUpgrade;
pub use self::upgrade::OutboundUpgrade;
pub use self::upgrade::UpgradeInfo;
pub use self::upgrade::ProtocolName;



Muxing is the process of splitting a connection into multiple substreams.


Low-level networking primitives.


Once we are connected to a node, a protocols handler handles one or more specific protocols on this connection.


High level manager of the network.


A network topology is a collection of nodes that are part of the network or that we think are part of the network. In other words, it is essentially a container whose layout is optimized for certain operations.


Handles entering a connection with a peer.


Contains everything related to upgrading a connection or a substream to use a protocol.



Representation of a Multiaddr.


Identifier of a peer of the network.



Public key used by the remote.


Error that can happen when upgrading a connection or substream to use a protocol.