Home

Awesome

latest release on CLN v24.05 latest release on CLN v24.02.2 latest release on CLN v23.11.2

main on CLN v24.05 main on CLN v24.02.2 main on CLN v23.11.2

holdinvoice

Core lightning (CLN) plugin to hold invoices. Supports rpc and grpc.

Installation

Release binaries for

can be found on the release page. If you are unsure about your architecture you can run uname -m.

They require glibc>=2.31, which you can check with ldd --version.

In your cln config you must add:

important-plugin=<path/to/holdinvoice>

and if you want to use the plugin via grpc you must add:

grpc-hold-port=<port>

to run a separate grpc server for the plugins methods.

Building

You can build the plugin yourself instead of using the release binaries. First clone the repo:

git clone https://github.com/daywalker90/holdinvoice.git

Install a recent rust version (rustup is recommended).

Install protobuf-compiler since we need protoc:

apt install protobuf-compiler

Then in the holdinvoice folder run:

cargo build --release

After that the binary will be here: target/release/holdinvoice

Note: Release binaries are built using cross and the optimized profile.

Documentation

There are four methods provided by this plugin:

The plugin will automatically cancel any invoice if it is either close to expiry (this is one major difference to the way lnd does it because cln can't settle with an expired invoice) or if a pending HTLC is close to expiry and would otherwise cause a force close of the channel. You can configure when this happens with the options below.

During a node restart invoices that were previously in the ACCEPTED state can temporarily be back in the OPEN state, because the HTLC's get replayed to the plugin during startup.

Options

You can set the following options in your cln config file: