Home

Awesome

latest release on CLN v24.08.2 latest release on CLN v24.05 latest release on CLN v24.02.2

main on CLN v24.08.2 main on CLN v24.05 main on CLN v24.02.2

clnrod

Core lightning (CLN) plugin to allow/deny incoming channel opens based on lists and/or a custom rule.

Installation

For general plugin installation instructions see the plugins repo README.md

Release binaries for

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

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

Building

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

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

Install a recent rust version (rustup is recommended).

Then in the clnrod folder run:

cargo build --release

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

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

Documentation

If you want to make sure that no channels open to you without going through this plugin, install it as an important-plugin. CLN will stop completely if the plugin should ever crash. If you only install clnrod as a normal plugin and it crashes, all channels will be accepted as usual.

Rpc methods

New rpc methods with this plugin:

Blockmode: allow

Setting the blockmode to allow means:

  1. if a channel opener's pubkey is on the allowlist (~/.lightning/<network>/clnrod/allowlist.txt) the channel will always be accepted, no matter the custom rule
  2. if such a pubkey is not on the allowlist it has to face the custom rule if their is one, otherwise it will be rejected
  3. if the custom rule returns true the channel will be accepted, otherwise (false) it will be rejected

Blockmode: deny

Setting the blockmode to deny means:

  1. if a channel opener's pubkey is on the denylist (~/.lightning/<network>/clnrod/denylist.txt) the channel will always be denied, no matter the custom rule
  2. if such a pubkey is not on the denylist it has to face the custom rule if their is one, otherwise it will be accepted
  3. if the custom rule returns true the channel will be accepted, otherwise (false) it will be rejected

Logs/E-mails

Email configuration is optional and everything gets logged regardless

Custom rule

The custom rule can make use of the following symbols:

Variables

Variables starting with cln_ query your own gossip, amboss_ the Amboss API and oneml_ the 1ML API. There is an one hour cache for collecting data that will be reset if you change the clnrod-customrule option.

Example: their_funding_sat >= 1000000 && their_funding_sat <= 50000000 && (amboss_has_email==true || amboss_has_nostr==true) will accept channels that are between 1000000 and 50000000 sats in size and either have a email or nostr info on amboss

How to set options

clnrod is a dynamic plugin with dynamic options, so you can start it after CLN is already running and modify it's options after the plugin is started. You have two different methods of setting the options:

  1. When starting the plugin dynamically.
  1. Permanently saving them in the CLN config file. :warning:If you want to do this while CLN is running you must use setconfig instead of manually editing your config file! :warning:If you have options in the config file (either by manually editing it or by using the setconfig command) make sure the plugin will start automatically with CLN (include plugin=/path/to/clnrod or have a symlink to clnrod in your plugins folder). This is because CLN will refuse to start with config options that don't have a corresponding plugin loaded. :warning:If you edit your config file manually while CLN is running and a line changes their line number CLN will crash when you use the setconfig command, so better stick to setconfig only during CLN's uptime!

You can mix two methods and if you set the same option with different methods, it will pick the value from your most recently used method.

Options

general

email