From c417ff8507e27b2d1adf0f4a2bfb63a296bfb782 Mon Sep 17 00:00:00 2001 From: Erik De Smedt Date: Wed, 22 Nov 2023 13:30:40 +0100 Subject: [PATCH] Docs: Add `custommsg` notification --- .../plugin-development/event-notifications.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/developers-guide/plugin-development/event-notifications.md b/doc/developers-guide/plugin-development/event-notifications.md index 3e7532594297..917de9c50f97 100644 --- a/doc/developers-guide/plugin-development/event-notifications.md +++ b/doc/developers-guide/plugin-development/event-notifications.md @@ -105,6 +105,28 @@ A notification for topic `disconnect` is sent every time a connection to a peer } ``` +### `custommsg` + +A notification for topic `custommsg` is sent when the node receives a `custommsg`. +```json +{ + "custommsg" : { + "peer_id" : "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432", + "payload" : "1337ffffffff" + } +} +``` + +This `payload` represents a `custommsg` that was send by the peer whose `node_id` matches +`peer_id`. The message has type `0x1337` and contents `ffffffff`. + +To avoid conflicts with internal state-tracking, unexpected disconnections and channel-closures +the messages are currently limited to odd-numbered messages that can be safely ignored by +other nodes (see ["it's ok to be odd" in the specification](https://github.com/lightning/bolts/blob/c74a3bbcf890799d343c62cb05fcbcdc952a1cf3/01-messaging.md#lightning-message-format) +for details). + +The plugin must implement the parsing of the message including the type prefix. + ### `invoice_payment` A notification for topic `invoice_payment` is sent every time an invoice is paid.