Commit Graph

38 Commits

Author SHA1 Message Date
Rusty Russell
d9d82ac5bd lightningd: add support for filters on "rpc_command" hook.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: the `rpc_command` hook can now specify a "filter" on what commands it is interested in.
2025-11-20 16:30:50 +10:30
ShahanaFarooqui
367efcf643 docs: Updated developers-guide docs for v10 2025-11-13 15:07:00 +10:30
Peter Neuroth
5c93f12b08 lightningd: add peer_id to htlc_accepted_hook
In some cases it is helpful to know who offered us the HTLC.

Changelog-Changed: Plugins: The `htlc_accepted` hook now knows the
`peer_id` of the peer that offered us the HTLC.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2025-11-11 16:36:30 +01:00
Peter Neuroth
21fb7600f3 lightningd: add invoice_amt to the htlc_accepted hook
This commit introduces a new field `invoice_msat` to the htlc_accepted
hook. If this field is specified it will replace the amount of the
invoice that belongs to the payment_hash of the HTLC on internal checks.

This is useful in scenarios where we actually expect a smaller amount
than initially specified in an invoice.

Changelog-Changed: Plugins: `htlc_accepted` hook can now override the
expected total amount of the invoice that belongs to the HTLC.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2025-11-10 15:05:27 +10:30
Rusty Russell
733bdfa67d lightningd: add channel_type to openchannel & openchannel2 hooks.
An obvious omission!

Changelog-Added: Plugins: `openchannel` and `openchannel2` hooks now expose the `channel_type` field for the offered channel.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-08-15 11:11:39 +09:30
Rusty Russell
650f3882dd lightningd: separate coin_movement tags array into primary_tag and extra_tags.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: JSON-RPC: `coin_movement` notification `tags` array (use `primary_tag` and `extra_tags`).
Changelog-Added: JSON-RPC: `coin_movement` notification `primary_tag` and `extra_tags`.
2025-08-14 19:49:09 +09:30
Rusty Russell
bc5e54d153 common: coin movements for payments need group id as well as part id.
The part id is *only* unique within a group.  The payment_hash / partid / groupid tuple is unique.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: `coin_movement` notification with `part_id` field now always has `group_id` field.
2025-08-14 19:49:09 +09:30
Peter Neuroth
40c01ea21b docs: Add extra_tlvs to the htlc_accepted_hook doc
Changelog-Added: The `htlc_accepted_hook` now gets the TLV-stream
attached to the HTLC passed through as `extra_tlvs` and can replace it.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2025-08-14 18:57:05 +09:30
Rusty Russell
e24bd9685a xpay: add pay_part_start and pay_part_end notifications.
Requested-by: Michael at Boltz
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: `xpay` now publishes `pay_part_start` and `pay_part_end` notifications on every payment send attempt.
2025-08-14 16:52:44 +09:30
ShahanaFarooqui
e5ec688bf4 doc: Fix links to avoid 404 error 2025-06-26 14:21:56 +09:30
Rusty Russell
73fc9b0c2a plugins: all plugins must now support non-numeric JSON RPC id fields.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: plugins which didn't accept string JSON RPC fields (deprecated v23.08, disabled by default in v24.11).
2025-03-12 09:26:08 +10:30
Erick λ
38b9cb94d3 docs: fix JSON indentation in 'connect' example Changelog-None 2025-02-17 15:59:12 +10:30
gudnuf
61482e5f45 new notifications: plugin_stopped and plugin_started
[Added version tag into documentation, to show it was added in 25.02 --RR]
Changelog-Added: Plugins: new nofitications `plugin_stopped` and `plugin_started`
2025-02-12 12:54:10 +10:30
Rusty Russell
f0c5ea2e1e doc: document and test the onionmessage_forward_fail notification.
Doing exactly what we expect to do: initiate a connection and then
forward the message.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-12-05 17:38:16 +10:30
Rusty Russell
1b413502e0 lightningd: deprecate experimental-offers option.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: Config: `experimental-offers` (it's now the default).
2024-11-18 10:42:54 +01:00
Rusty Russell
8293352425 config: add the ability for plugins to specify that config values should be concealed.
And use it for `exposesecret-passphrase`.  This is probably overly
cautious, but it makes me feel a little better that we won't leak it
to someone with read-only access.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-11-13 08:49:55 +10:30
ShahanaFarooqui
a82f1feb3a pyln-client: Deprecate category, description and long description from method
Category, description and long description from `json_command` and `plugin_command` have been removed in favour of getting them from json schema.  Reference PR: Add categories in RPC documentation #7485

Deprecating them in pyln-client as well. They will remove completely in future releases.

Changelog-Deprecated: pyln-client: category, description and long descriptions for RPC commands are deprecated now.
2024-08-07 10:19:55 +09:30
Vincenzo Palazzo
b5cfd981a1 docs: adds documentation about the log notification
Changelog-None: docs: adds documentation about the log notification
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-17 13:03:12 -05:00
Rusty Russell
cb2c4963f2 bolt12: allow first_node_id in blinded path to be a scid.
We don't actually support it yet, but this threads through the type change,
puts it in "decode" etc.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-12 19:11:43 -05:00
Vincenzo Palazzo
081a2eef6c docs: fixing the json response in documentation
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-09 23:19:29 -05:00
Rusty Russell
11ffbc305e lightningd: allow plugins to specify cancheck for us to pass check commands through.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: Can now opt in to handle `check` command on their commands, for more thorough checking.
2024-05-06 20:51:19 -05:00
ShahanaFarooqui
7e33a10425 doc: Schema generation instructions update 2024-03-19 14:58:59 +10:30
Erik De Smedt
7827a26685 Docfix: connec-notification
The previous example was updated.
2024-02-16 17:54:31 +01:00
shuoer86
6c04a6c15a doc: fix typos 2024-02-11 11:27:41 +01:00
Rusty Russell
2914d3adfc plugins: allow plugins to get per-connection deprecated state.
Unfortunately, this is awkward: we just copy through most requests,
so we can't easily add a "deprecation" field to each one.  So we do
a notification if the next command has a different deprecation status
than the global one, but that requires opt-in from the plugin.

We didn't previously document the subscriptions array, so do that now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: `deprecated_oneshot` notifiction subscription to change deprecated status for a single command.
2024-01-26 10:30:22 +10:30
Rusty Russell
3281d8c0ab plugins: allow plugin options deprecated to be an array of strings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugin: options and commands can specify deprecation start (and optional end) versions.
2024-01-26 10:30:22 +10:30
Erik De Smedt
36f69a1a98 Docs: Add custommsg notification 2023-12-16 11:36:42 +10:30
ShahanaFarooqui
b250bca429 doc: documentation update for hooks and testing
Changelog-None.

Based upon suggestions:
https://dash.readme.com/project/blockstream-core-lightning/v1/suggested/update/655c70ab0077d2003b3b657b
https://dash.readme.com/project/blockstream-core-lightning/v1/suggested/update/655c8b912adff80063e82be8
2023-12-15 10:19:14 +10:30
Erik De Smedt
151a431628 Docs: Consistent whitespace in developers guide
The example used a mix of whitespace and tabs to format the JSON
which made it appear poorly on my device.
2023-12-15 10:18:04 +10:30
Erik De Smedt
1754858ca7 Doc fix: dynamic options
When the value of a `dynamic` option is updated core Lightning
will make a JSON-RPC request to the plugin.

The documentation falsely mentioned the request has a method named
`setvalue. It appears it is actually called `setconfig`.
2023-12-15 09:40:29 +10:30
Erik De Smedt
c404ebedcc Doc: Formatting
Fixed formatting of json.

Combination of tabs and spaces made the json looks bad on
my device
2023-12-12 16:53:59 +01:00
Erik De Smedt
acce3b1b32 Fix docs for invoice_payment hook and notification
The data-format changed in 2019.
The field `amount_msat` was renamed to `msat`
(See 2907e430d5)

The data-format changed again in november 2023.
The content of the field `amount_msat` was changed.
It was a string `"1000msat"` and became a number `1000`.
(See 0b23133ab2)

The current documentation still mentions the data-format before
2907e430d5.

I've updated the docs to reflect the latest changes.
I've also incluced a short mention of 0b23133ab2 to help help
developers create plugins that work both pre 23.11 and post 23.11.
2023-12-12 16:53:59 +01:00
Chris Guida
8bbf2342f7 lightningd: adapt invoice_try_pay declaration for onchain payment.
i.e. `set` may be NULL, so we need to explicitly hand the amount.
We also add an outpoint.
2023-10-26 19:11:17 +10:30
Rusty Russell
774719530e plugins: allow plugins to specify even messages they accept.
Changelog-Added: Plugins: plugins can now specify (unknown) even messages we should accept from peers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-24 11:50:57 +10:30
Christian Decker
e0f97cab1b doc: Drive-by fixes of JSON examples in hooks.md 2023-08-16 12:26:43 +09:30
Rusty Russell
0f6687ec7b codex32: use "cl" instead of "ms" as our HRP.
This was strongly recommended by Russell O'Connor: the "ms" implies that
it's a BIP-32 master secret, and this is CLN specific.

If we changed the hrp to "cln" it would be better, but apparently that
means we no longer fit in a "standard billfold metal wallet" (and
our code assumes a 2-byte prefix anyway).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-08-02 16:12:32 +09:30
adi2011
97bc3ae20a doc: Add documentation for --recover flag. 2023-07-31 11:29:59 +09:30
Adi Shankara
b2caa56c27 update new documentation and move to doc/ 2023-07-16 12:59:40 +09:30