Module msgs
Expand description
Wire messages, traits representing wire message handlers, and a few error types live here.
For a normal node you probably don’t need to use anything here, however, if you wish to split a
node into an internet-facing route/message socket handling daemon and a separate daemon (or
server entirely) which handles only channel-related messages you may wish to implement
ChannelMessageHandler yourself and use it to re-serialize messages and pass them across
daemons/servers.
Note that if you go with such an architecture (instead of passing raw socket events to a
non-internet-facing system) you trust the frontend internet-facing system to not lie about the
source node_id of the message, however this does allow you to significantly reduce bandwidth
between the systems as routing messages can represent a significant chunk of bandwidth usage
(especially for non-channel-publicly-announcing nodes). As an alternate design which avoids
this issue, if you have sufficient bidirectional bandwidth between your systems, you may send
raw socket events into your non-internet-facing system and then send routing events back to
track the network on the less-secure system.
Structs§
- Accept
Channel - An
accept_channelmessage to be sent to or received from a peer. - Accept
Channel V2 - An accept_channel2 message to be sent by or received from the channel accepter.
- Announcement
Signatures - An
announcement_signaturesmessage to be sent to or received from a peer. - Channel
Announcement - A
channel_announcementmessage to be sent to or received from a peer. - Channel
Ready - A
channel_readymessage to be sent to or received from a peer. - Channel
Reestablish - A
channel_reestablishmessage to be sent to or received from a peer. - Channel
Update - A
channel_updatemessage to be sent to or received from a peer. - Closing
Signed - A
closing_signedmessage to be sent to or received from a peer. - Closing
Signed FeeRange - The minimum and maximum fees which the sender is willing to place on the closing transaction.
- Commitment
Signed - A
commitment_signedmessage to be sent to or received from a peer. - Commitment
Update - Struct used to return values from
RevokeAndACKmessages, containing a bunch of commitment transaction updates if they were pending. - Common
Accept Channel Fields - Contains fields that are both common to
accept_channelandaccept_channel2messages. - Common
Open Channel Fields - Contains fields that are both common to
open_channelandopen_channel2messages. - Error
Message - An
errormessage to be sent to or received from a peer. - Final
Onion HopData - Information communicated in the onion to the recipient for multi-part tracking and proof that the payment is associated with an invoice.
- Funding
Created - A
funding_createdmessage to be sent to or received from a peer. - Funding
Signed - A
funding_signedmessage to be sent to or received from a peer. - Gossip
Timestamp Filter - A
gossip_timestamp_filtermessage is used by a node to request gossip relay for messages in the requested time range when thegossip_queriesfeature has been negotiated. - Init
- An
initmessage to be sent to or received from a peer. - Lightning
Error - An Err type for failure to process messages.
- Node
Announcement - A
node_announcementmessage to be sent to or received from a peer. - Onion
Message - An onion message to be sent to or received from a peer.
- Onion
Packet - BOLT 4 onion packet including hop data for the next peer.
- Open
Channel - An
open_channelmessage to be sent to or received from a peer. - Open
Channel V2 - An open_channel2 message to be sent by or received from the channel initiator.
- Ping
- A
pingmessage to be sent to or received from a peer. - Pong
- A
pongmessage to be sent to or received from a peer. - Query
Channel Range - A
query_channel_rangemessage is used to query a peer for channel UTXOs in a range of blocks. The recipient of a query makes a best effort to reply to the query using one or moreReplyChannelRangemessages. - Query
Short Channel Ids - A
query_short_channel_idsmessage is used to query a peer for routing gossip messages related to one or moreshort_channel_ids. - Reply
Channel Range - A
reply_channel_rangemessage is a reply to aQueryChannelRangemessage. - Reply
Short Channel IdsEnd - A
reply_short_channel_ids_endmessage is sent as a reply to a message. The query recipient makes a best effort to respond based on their local network view which may not be a perfect view of the network. - Revoke
AndACK - A
revoke_and_ackmessage to be sent to or received from a peer. - Shutdown
- A
shutdownmessage to be sent to or received from a peer. - Splice
- A splice message to be sent by or received from the stfu initiator (splice initiator).
- Splice
Ack - A splice_ack message to be received by or sent to the splice initiator.
- Splice
Locked - A splice_locked message to be sent to or received from a peer.
- Stfu
- An stfu (quiescence) message to be sent by or received from the stfu initiator.
- Trampoline
Onion Packet - BOLT 4 onion packet including hop data for the next peer.
- TxAbort
- A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
- TxAck
Rbf - A tx_ack_rbf message which acknowledges replacement of the transaction after it’s been completed.
- TxAdd
Input - A tx_add_input message for adding an input during interactive transaction construction
- TxAdd
Output - A tx_add_output message for adding an output during interactive transaction construction.
- TxComplete
- A tx_complete message signalling the conclusion of a peer’s transaction contributions during interactive transaction construction.
- TxInit
Rbf - A tx_init_rbf message which initiates a replacement of the transaction after it’s been completed.
- TxRemove
Input - A tx_remove_input message for removing an input during interactive transaction construction.
- TxRemove
Output - A tx_remove_output message for removing an output during interactive transaction construction.
- TxSignatures
- A tx_signatures message containing the sender’s signatures for a transaction constructed with interactive transaction construction.
- Unsigned
Channel Announcement - The unsigned part of a
channel_announcementmessage. - Unsigned
Channel Update - The unsigned part of a
channel_updatemessage. - Unsigned
Node Announcement - The unsigned part of a
node_announcementmessage. - Update
AddHTLC - An
update_add_htlcmessage to be sent to or received from a peer. - Update
FailHTLC - An
update_fail_htlcmessage to be sent to or received from a peer. - Update
Fail MalformedHTLC - An
update_fail_malformed_htlcmessage to be sent to or received from a peer. - Update
Fee - An
update_feemessage to be sent to or received from a peer - Update
FulfillHTLC - An
update_fulfill_htlcmessage to be sent to or received from a peer. - Warning
Message - A
warningmessage to be sent to or received from a peer.
Enums§
- Decode
Error - An error in decoding a message or struct.
- Error
Action - Used to put an error message in a
LightningError. - Socket
Address - An address which can be used to connect to a remote peer.
- Socket
Address Parse Error SocketAddresserror variants- Unsigned
Gossip Message - Represents the set of gossip messages that require a signature from a node’s identity key.
Traits§
- Channel
Message Handler - A trait to describe an object which can receive channel messages.
- Onion
Message Handler - A handler for received
OnionMessages and for providing generated ones to send. - Routing
Message Handler - A trait to describe an object which can receive routing messages.
Functions§
- parse_
onion_ address - Parses an OnionV3 host and port into a
SocketAddress::OnionV3.
Type Aliases§
- Serial
Id - A randomly chosen number that is used to identify inputs within an interactive transaction construction.