2022-05-13 18:02:51 +02:00
# Plugins for Core-Lightning
2019-01-21 19:45:55 +01:00
2022-05-13 18:02:51 +02:00
Community curated plugins for Core-Lightning.
2019-01-21 19:45:55 +01:00
2020-12-02 11:10:46 +01:00

2019-05-04 11:43:56 +02:00
2019-01-21 19:45:55 +01:00
## Available plugins
2022-09-09 09:01:28 -03:00
| Name | Short description |
| ------------------------------------ | ------------------------------------------------------------------------------------------- |
| [autopilot][autopilot] | An autopilot that suggests channels that should be established |
| [backup][backup] | A simple and reliable backup plugin |
| [boltz-channel-creation][boltz] | A Core-Lightning plugin for Boltz Channel Creation Swaps |
| [btcli4j][btcli4j] | A Bitcoin Backend to enable safely the pruning mode, and support also rest APIs. |
2022-09-01 16:22:47 +02:00
| [circular][circular] | A smart rebalancing plugin for Core Lightning routing nodes |
2022-09-09 09:01:28 -03:00
| [csvexportpays][csvexportpays] | A plugin that exports all payments to a CSV file |
| [currencyrate][currencyrate] | A plugin to convert other currencies to BTC using web requests |
| [donations][donations] | A simple donations page to accept donations from the web |
| [drain][drain] | Draining, filling and balancing channels with automatic chunks. |
| [event-websocket][event-websocket] | Exposes notifications over a Websocket |
| [feeadjuster][feeadjuster] | Dynamic fees to keep your channels more balanced |
| [go-lnmetrics.reporter][reporter] | Collect and report of the lightning node metrics |
| [graphql][graphql] | Exposes the Core-Lightning API over [graphql][graphql-spec] |
| [invoice-queue][invoice-queue] | Listen to lightning invoices from multiple nodes and send to a redis queue for processing |
| [lightning-qt][lightning-qt] | A bitcoin-qt-like GUI for lightningd |
| [listmempoolfunds][listmempoolfunds] | Track unconfirmed wallet deposits |
| [monitor][monitor] | helps you analyze the health of your peers and channels |
| [noise][noise] | Chat with your fellow node operators |
| [paythrough][paythrough] | Pay an invoice through a specific channel, regardless of better routes |
| [persistent-channels][pers-chans] | Maintains a number of channels to peers |
| [poncho][poncho] | Turns CLN into a [hosted channels][blip12] provider |
| [probe][probe] | Regularly probes the network for stability |
| [prometheus][prometheus] | Lightning node exporter for the prometheus timeseries server |
| [pruning][pruning] | This plugin manages pruning of bitcoind such that it can always sync |
2022-11-15 01:45:37 +05:30
| [python-teos][python-teos] | The Eye of Satoshi - Lightning Watchtower |
2022-09-09 09:01:28 -03:00
| [rebalance][rebalance] | Keeps your channels balanced |
| [reckless][reckless] | An **experimental** plugin manager (search/install plugins) |
| [requestinvoice][request-invoice] | Http server to request invoices |
| [sauron][sauron] | A Bitcoin backend relying on [Esplora][esplora]'s API |
| [sitzprobe][sitzprobe] | A Lightning Network payment rehearsal utility |
| [sparko][sparko] | RPC over HTTP with fine-grained permissions, SSE and spark-wallet support |
| [summary][summary] | Print a nice summary of the node status |
| [trustedcoin][trustedcoin] | Replace your Bitcoin Core with data from public block explorers |
| [webhook][webhook] | Dispatches webhooks based from [event notifications][event-notifications] |
| [watchtower][watchtower-client] | Watchtower client for The Eye of Satoshi |
| [zmq][zmq] | Publishes notifications via [ZeroMQ][zmq-home] to configured endpoints |
| [nloop][nloop] | Generic Lightning Loop for boltz |
2019-01-21 19:47:05 +01:00
2019-05-13 12:05:15 +02:00
## Installation
To install and activate a plugin you need to stop your lightningd and restart it
with the `plugin` argument like this:
```
lightningd --plugin=/path/to/plugin/directory/plugin_file_name.py
```
Notes:
- The `plugin_file_name.py` must have executable permissions:
`chmod a+x plugin_file_name.py`
- A plugin can be written in any programming language, as it interacts with
`lightningd` purely using stdin/stdout pipes.
2019-05-21 10:15:46 +02:00
### Automatic plugin initialization
2019-05-13 12:05:15 +02:00
2019-05-21 10:15:46 +02:00
Alternatively, especially when you use multiple plugins, you can copy or symlink
all plugin directories into your `~/.lightning/plugins` directory. The daemon
2020-12-11 12:33:44 +01:00
will load each executable it finds in sub-directories as a plugin. In this case
2019-05-21 10:15:46 +02:00
you don't need to manage all the `--plugin=...` parameters.
2019-05-13 12:05:15 +02:00
2020-12-11 12:33:44 +01:00
### Dynamic plugin initialization
Most of the plugins can be managed using the RPC interface. Use
```
lightning-cli plugin start /path/to/plugin/directory/plugin_file_name
```
to start it, and
```
lightning-cli plugin stop /path/to/plugin/directory/plugin_file_name
```
to stop it.
As a plugin developer this option is configurable with all the available plugin libraries,
and defaults to `true` .
2019-12-12 11:08:46 +01:00
### PYTHONPATH and `pyln`
2019-05-13 12:05:15 +02:00
2019-12-05 01:29:10 +01:00
To simplify plugin development you can rely on `pyln-client` for the plugin
implementation, `pyln-proto` if you need to parse or write lightning protocol
messages, and `pyln-testing` in order to write tests. These libraries can be
retrieved in a number of different ways:
2019-05-13 12:05:15 +02:00
2019-12-05 01:29:10 +01:00
- Using `pip` tools: `pip3 install pyln-client pyln-testing`
2019-05-13 12:05:15 +02:00
- Using the `PYTHONPATH` environment variable to include your clightning's
2019-12-05 01:29:10 +01:00
shipped `pyln-*` libraries:
2019-05-13 12:05:15 +02:00
```bash
2019-12-12 11:08:46 +01:00
export PYTHONPATH=/path/to/lightnind/contrib/pyln-client:/path/to/lightnind/contrib/pyln-testing:$PYTHONPATH
2019-05-13 12:05:15 +02:00
```
2019-12-05 01:29:10 +01:00
### Writing tests
The `pyln-testing` library provides a number of helpers and fixtures to write
tests. While not strictly necessary, writing a test will ensure that your
plugin is working correctly against a number of configurations (both with and
without `DEVELOPER` , `COMPAT` and `EXPERIMENTAL_FEATURES` ), and more
importantly that they will continue to work with newly release versions of
2022-05-13 18:02:51 +02:00
Core-Lightning.
2019-12-05 01:29:10 +01:00
Writing a test is as simple as this:
2019-12-12 11:08:46 +01:00
- The framework will look for unittest filenames starting with `test_` .
- The test functions should also start with `test_` .
2019-12-05 01:29:10 +01:00
```python
from pyln.testing.fixtures import *
2019-12-12 11:08:46 +01:00
pluginopt = {'plugin': os.path.join(os.path.dirname(__file__), "YOUR_PLUGIN.py")}
def test_your_plugin(node_factory, bitcoind):
2019-12-05 01:29:10 +01:00
l1 = node_factory.get_node(options=pluginopt)
2019-12-12 11:08:46 +01:00
s = l1.rpc.getinfo()
2020-12-10 16:36:11 +08:00
assert(s['network'] == 'regtest') # or whatever you want to test
2019-12-05 01:29:10 +01:00
```
Tests are run against pull requests, all commits on `master` , as well as once
2022-05-13 18:02:51 +02:00
ever 24 hours to test against the latest `master` branch of the Core-Lightning
2019-12-05 01:29:10 +01:00
development tree.
2019-12-12 11:08:46 +01:00
Running tests locally can be done like this:
(make sure the `PYTHONPATH` env variable is correct)
```bash
pytest YOUR_PLUGIN/YOUR_TEST.py
```
2020-12-11 12:41:06 +01:00
### Python plugins specifics
#### Additional dependencies
2019-05-13 12:05:15 +02:00
Additionally, some Python plugins come with a `requirements.txt` which can be
used to install the plugin's dependencies using the `pip` tools:
```bash
pip3 install -r requirements.txt
```
Note: You might need to also specify the `--user` command line flag depending on
your environment.
2020-12-11 12:41:06 +01:00
#### Minimum supported Python version
The minimum supported version of Python for this repository is currently `3.6.x` (23 Dec 2016).
Python plugins users must ensure to have a version `>= 3.6` .
Python plugins developers must ensure their plugin to work with all Python versions `>= 3.6` .
2019-05-13 12:05:15 +02:00
2019-03-28 17:17:00 +01:00
## More Plugins from the Community
2019-09-22 18:57:47 -03:00
- [@conscott's plugins ](https://github.com/conscott/c-lightning-plugins )
- [@renepickhardt's plugins ](https://github.com/renepickhardt/c-lightning-plugin-collection )
- [@rsbondi's plugins ](https://github.com/rsbondi/clightning-go-plugin )
2022-05-13 18:02:51 +02:00
- [Core-Lightning plugins emulating commands of LND (lncli) ](https://github.com/kristapsk/c-lightning-lnd-plugins )
2019-03-28 17:17:00 +01:00
## Plugin Builder Resources
- [Description of the plugin API][plugin-docs]
- [C Plugin API][c-api] by @rustyrussell
2019-05-04 11:43:56 +02:00
- [Python Plugin API & RPC Client][python-api] ([PyPI][python-api-pypi]) by @cdecker and [a video tutorial ](https://www.youtube.com/watch?v=FYs1I-pCJIg ) by @renepickhardt
2019-03-28 17:17:00 +01:00
- [Go Plugin API & RPC Client][go-api] by @niftynei
2019-07-20 18:53:00 +02:00
- [C++ Plugin API & RPC Client][cpp-api] by @darosior
2019-07-25 11:20:44 +02:00
- [Javascript Plugin API & RPC Client][js-api] by @darosior
2022-03-06 09:56:31 +01:00
- [TypeScript Plugin API & RPC Client][ts-api] by @AaronDewes
2021-06-06 00:19:16 +02:00
- [Java Plugin API & RPC Client][java-api] by @vincenzopalazzo
2022-03-28 12:23:35 +09:00
- [C# Plugin Guideline and example project][csharp-example] by @joemphilips
- [Kotlin plugin guideline and example][kotlin-example] by @vincenzopalazzo
2019-03-28 17:17:00 +01:00
2022-12-28 17:29:15 +01:00
## Archived plugins
The following is a list of archived plugins that no longer maintained.
If you like a plugin from that list, feel free to update and fix it, so we can
un-archive it.
| Name | Short description |
| ------------------------------------ | ------------------------------------------------------------------------------------------- |
| [commando][commando] | Authorize peers to run commands on your node, and running commands on them. |
2020-03-30 17:22:39 +02:00
[esplora]: https://github.com/Blockstream/esplora
2019-01-21 19:47:05 +01:00
[pers-chans]: https://github.com/lightningd/plugins/tree/master/persistent-channels
2019-02-26 18:41:38 +01:00
[probe]: https://github.com/lightningd/plugins/tree/master/probe
2022-01-09 12:51:42 +01:00
[noise]: https://github.com/lightningd/plugins/tree/master/noise
2019-02-26 18:41:38 +01:00
[prometheus]: https://github.com/lightningd/plugins/tree/master/prometheus
2019-03-26 12:44:47 +01:00
[summary]: https://github.com/lightningd/plugins/tree/master/summary
2019-03-28 16:09:12 +01:00
[donations]: https://github.com/lightningd/plugins/tree/master/donations
2020-07-25 11:51:41 +02:00
[drain]: https://github.com/lightningd/plugins/tree/master/drain
2019-03-28 17:17:00 +01:00
[plugin-docs]: https://lightning.readthedocs.io/PLUGINS.html
[c-api]: https://github.com/ElementsProject/lightning/blob/master/plugins/libplugin.h
2020-12-15 14:23:52 +10:30
[currencyrate]: https://github.com/lightningd/plugins/tree/master/currencyrate
2019-03-28 17:17:00 +01:00
[python-api]: https://github.com/ElementsProject/lightning/tree/master/contrib/pylightning
[python-api-pypi]: https://pypi.org/project/pylightning/
[go-api]: https://github.com/niftynei/glightning
2019-04-29 15:29:24 +02:00
[sitzprobe]: https://github.com/niftynei/sitzprobe
[autopilot]: https://github.com/lightningd/plugins/tree/master/autopilot
[rebalance]: https://github.com/lightningd/plugins/tree/master/rebalance
[graphql]: https://github.com/nettijoe96/c-lightning-graphql
[graphql-spec]: https://graphql.org/
2019-05-16 20:28:25 +02:00
[lightning-qt]: https://github.com/darosior/pylightning-qt
2021-12-19 15:14:35 +01:00
[listmempoolfunds]: https://github.com/andrewtoth/listmempoolfunds
2022-07-19 15:01:23 -04:00
[paythrough]: https://github.com/andrewtoth/paythrough
2019-07-20 18:53:00 +02:00
[cpp-api]: https://github.com/darosior/lightningcpp
2020-12-11 12:33:44 +01:00
[js-api]: https://github.com/lightningd/clightningjs
2022-03-06 09:56:31 +01:00
[ts-api]: https://github.com/runcitadel/c-lightning.ts
2019-07-27 01:09:50 +02:00
[monitor]: https://github.com/renepickhardt/plugins/tree/master/monitor
2019-08-10 17:19:37 +02:00
[reckless]: https://github.com/darosior/reckless
2020-02-11 14:24:40 +01:00
[request-invoice]: https://github.com/lightningd/plugins/tree/master/request-invoice
2020-03-30 17:22:39 +02:00
[sauron]: https://github.com/lightningd/plugins/tree/master/sauron
2019-12-01 14:11:23 -07:00
[zmq-home]: https://zeromq.org/
[zmq]: https://github.com/lightningd/plugins/tree/master/zmq
2019-12-25 18:30:24 +01:00
[csvexportpays]: https://github.com/0xB10C/c-lightning-plugin-csvexportpays
2020-07-03 11:42:19 +02:00
[pruning]: https://github.com/Start9Labs/c-lightning-pruning-plugin
2020-08-11 23:17:07 -03:00
[sparko]: https://github.com/fiatjaf/sparko
[webhook]: https://github.com/fiatjaf/webhook
[trustedcoin]: https://github.com/fiatjaf/trustedcoin
[event-notifications]: https://lightning.readthedocs.io/PLUGINS.html#event -notifications
2020-08-28 16:30:33 +02:00
[event-websocket]: https://github.com/rbndg/c-lightning-events
[invoice-queue]: https://github.com/rbndg/Lightning-Invoice-Queue
2020-09-04 16:29:27 +02:00
[boltz]: https://github.com/BoltzExchange/channel-creation-plugin
2020-10-30 16:50:06 +01:00
[feeadjuster]: https://github.com/lightningd/plugins/tree/master/feeadjuster
2022-07-22 15:48:07 +02:00
[watchtower-client]: https://github.com/talaia-labs/rust-teos/tree/master/watchtower-plugin
2021-06-06 00:19:16 +02:00
[java-api]: https://github.com/clightning4j/JRPClightning
2022-09-09 08:44:02 -03:00
[btcli4j]: https://github.com/clightning4j/btcli4j
2021-07-25 01:02:43 -04:00
[backup]: https://github.com/lightningd/plugins/tree/master/backup
2022-12-28 17:29:15 +01:00
[commando]: https://github.com/lightningd/plugins/tree/master/archive/commando
2021-11-30 14:35:04 +01:00
[reporter]: https://github.com/LNOpenMetrics/go-lnmetrics.reporter
2022-05-20 15:15:32 +09:00
[csharp-example]: https://github.com/joemphilips/DotNetLightning/tree/master/examples/HelloWorldPlugin
2022-09-01 19:30:11 +09:00
[kotlin-example]: https://vincenzopalazzo.medium.com/a-day-in-a-c-lightning-plugin-with-koltin-c8bbd4fa0406
2022-09-09 08:44:02 -03:00
[nloop]: https://github.com/bitbankinc/NLoop
[poncho]: https://github.com/fiatjaf/poncho
[blip12]: https://github.com/lightning/blips/blob/42cec1d0f66eb68c840443abb609a5a9acb34f8e/blip-0012.md
2022-09-01 16:26:57 +02:00
[circular]: https://github.com/giovannizotta/circular
2022-11-15 01:45:37 +05:30
[python-teos]: https://github.com/talaia-labs/python-teos