Module network

Source
Expand description

Network logic

Modules§

behaviours
networking behaviours wrapping libp2p’s behaviours
cbor
Forked cbor codec with altered request/response sizes
def 🔒
defines the swarm and network definition (internal)
node 🔒
functionality of a libp2p network node
transport
Alternative Libp2p transport implementations

Structs§

GossipConfig
Configuration for Libp2p’s Gossipsub
NetworkDef
Overarching network behaviour performing:
NetworkNode
Network definition
NetworkNodeConfig
describe the configuration of the network
NetworkNodeConfigBuilder
Builder for NetworkNodeConfig.
NetworkNodeHandle
A handle containing:
NetworkNodeReceiver
internal network node receiver
RequestResponseConfig
Configuration for Libp2p’s request-response

Enums§

ClientRequest
Actions to send from the client to the swarm
NetworkEvent
events generated by the swarm that we wish to relay to the client
NetworkEventInternal
internal representation of the network events only used for event processing before relaying to client
NetworkNodeConfigBuilderError
Error type for NetworkNodeConfigBuilder

Constants§

DEFAULT_REPLICATION_FACTOR
The default Kademlia replication factor

Functions§

gen_multiaddr
Bind all interfaces on port port NOTE we may want something more general in the fture.
gen_transport
Generates an authenticated transport checked against the stake table. If the stake table or authentication message is not provided, the transport will not participate in stake table authentication.
spawn_network_node
Spawn a network node task task and return the handle and the receiver for it

Type Aliases§

BoxedTransport 🔒
BoxedTransport is a type alias for a boxed tuple containing a PeerId and a StreamMuxerBox.