2021-07-13 23:04:30 +02:00
|
|
|
lightning-sendcustommsg -- Low-level interface to send protocol messages to peers
|
2019-12-09 16:32:49 +01:00
|
|
|
=====================================================================================
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
2021-07-13 23:04:30 +02:00
|
|
|
**sendcustommsg** *node_id* *msg*
|
2019-12-09 16:32:49 +01:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
2021-07-13 23:04:30 +02:00
|
|
|
The `sendcustommsg` RPC method allows the user to inject a custom message
|
2019-12-09 16:32:49 +01:00
|
|
|
into the communication with the peer with the given `node_id`. This is
|
|
|
|
intended as a low-level interface to implement custom protocol extensions on
|
|
|
|
top, not for direct use by end-users.
|
|
|
|
|
|
|
|
The message must be a hex encoded well-formed message, including the 2-byte
|
|
|
|
type prefix, but excluding the length prefix which will be added by the RPC
|
|
|
|
method. The messages must not use even-numbered types, since these may require
|
|
|
|
synchronous handling on the receiving side, and can cause the connection to be
|
|
|
|
dropped. The message types may also not use one of the internally handled
|
|
|
|
types, since that may cause issues with the internal state tracking of
|
2022-04-06 07:09:48 +02:00
|
|
|
Core Lightning.
|
2019-12-09 16:32:49 +01:00
|
|
|
|
|
|
|
The node specified by `node_id` must be a peer, i.e., it must have a direct
|
|
|
|
connection with the node receiving the RPC call, and the connection must be
|
|
|
|
established. For a method to send arbitrary messages over multiple hops,
|
|
|
|
including hops that do not understand the custom message, see the
|
|
|
|
`createonion` and `sendonion` RPC methods. Messages can only be injected if
|
|
|
|
the connection is handled by `openingd` or `channeld`. Messages cannot be
|
|
|
|
injected when the peer is handled by `onchaind` or `closingd` since these do
|
|
|
|
not have a connection, or are synchronous daemons that do not handle
|
|
|
|
spontaneous messages.
|
|
|
|
|
|
|
|
On the reveiving end a plugin may implement the `custommsg` plugin hook and
|
|
|
|
get notified about incoming messages.
|
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
------------
|
|
|
|
|
|
|
|
The method will validate the arguments and queue the message for delivery
|
|
|
|
through the daemon that is currently handling the connection. Queuing provides
|
|
|
|
best effort guarantees and the message may not be delivered if the connection
|
|
|
|
is terminated while the message is queued. The RPC method will return as soon
|
|
|
|
as the message is queued.
|
|
|
|
|
|
|
|
If any of the above limitations is not respected the method returns an
|
|
|
|
explicit error message stating the issue.
|
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-START)
|
|
|
|
On success, an object is returned, containing:
|
|
|
|
- **status** (string): Information about where message was queued
|
2021-09-03 12:07:59 +02:00
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-END)
|
|
|
|
|
2019-12-09 16:32:49 +01:00
|
|
|
AUTHOR
|
|
|
|
------
|
|
|
|
|
|
|
|
Christian Decker <<decker.christian@gmail.com>> is mainly responsible.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
|
|
|
|
lightning-createonion(7), lightning-sendonion(7)
|
|
|
|
|
|
|
|
RESOURCES
|
|
|
|
---------
|
|
|
|
|
|
|
|
Main web site: <https://github.com/ElementsProject/lightning>
|
2020-08-25 03:33:16 +02:00
|
|
|
|
2022-07-13 17:45:39 +02:00
|
|
|
[comment]: # ( SHA256STAMP:29749d2978455477670d15627d51a6c1e9493136431539640a81e85ab7104d4e)
|