Skip to main content

Module transport

Module transport 

Source
Expand description

Alternative Libp2p transport implementations

Structsยง

AuthMessage ๐Ÿ”’
The deserialized form of an authentication message that is sent to the remote peer
ConsensusKeyAuthentication
A wrapper for a Transport that bidirectionally associates (and verifies) the corresponding consensus keys.

Constantsยง

AUTH_HANDSHAKE_TIMEOUT ๐Ÿ”’
The timeout for the authentication handshake. This is used to prevent attacks that keep connections open indefinitely by half-finishing the handshake.
MAX_AUTH_MESSAGE_SIZE ๐Ÿ”’
The maximum size of an authentication message. This is used to prevent DoS attacks by sending large messages.

Traitsยง

AsOutput ๐Ÿ”’
A helper trait that allows us to access the underlying connection and PeerId from a transport output

Functionsยง

construct_auth_message
Create an sign an authentication message to be sent to the remote peer
read_length_delimited
A helper function to read a length-delimited message from a stream. Takes into account the maximum message size.
write_length_delimited
A helper function to write a length-delimited message to a stream.

Type Aliasesยง

UpgradeFuture ๐Ÿ”’
A type alias for the future that upgrades a connection to perform the authentication handshake