Expand description
LNP transport level works with framed messages of defined size. This messages can be put into different underlying transport protocols, including streaming protocols (like TCP), or overlaid over application-level protocols like HTTP, Websockets, SMTP (for high-latency communication networks). Current mod implements such overlays and provides TCP with the required framing functionality (this variant is called FTCP). It also integrates with ZMQ such that the upper level can abstract for a particular transport protocol used.
Re-exports
pub use socket_addr::FramingProtocol;
pub use socket_addr::LocalSocketAddr;
pub use socket_addr::RemoteSocketAddr;
pub use zmqsocket::ZmqSocketAddr;
pub use zmqsocket::ZmqType;
pub use zmqsocket::ZMQ_CONTEXT;
pub use zmqsocket::ZMQ_CONTEXT;
Modules
Brontide protocol: reads & writes frames (corresponding to LNP messages) from TCP stream according to BOLT-8 requirements.
Framed TCP protocol: reads & writes frames (corresponding to LNP messages) from TCP stream
Types generic over specific implementations
Module supports transport-level addressing, i.e. the one used before
encryption/decryption of the actual data are taking place. These addresses
is mostly used internally and does not include information about node
public key (for that purpose you need to use session-level address
structures like crate::NodeAddr
).
Structs
Enums
Transport protocol-level errors
Constants
Size of the frame prefix which is not included into payload size, consisting of the 2-bytes message size data and 16-byte MAC of the payload length
Size of the frame suffix represented by a 16-byte MAC of the frame payload
Maximum size of the frame payload which may be expressed by two bytes
Maximum size of the transport frame; chosen in compliance with LN specs
Traits
Marker trait for types that can provide a concrete implementation for both
frame parser implementing RecvFrame
and frame composer implementing
SendFrame
. These types must also implement amplify::Bipolar
, i.e.
they must be splittable into the receiving and sending half-types.
Frame receiving type which is able to parse raw data (streamed or framed by an underlying overlaid protocol such as ZMQ, HTTP, Websocket).
Frame sending type which is able to compose frame with a given raw data and send it via an underlying overlaid protocol such as ZMQ, HTTP, Websocket.