No description
Find a file
2020-11-11 12:00:27 +01:00
.travis travis: Reduce build parallelism 2020-08-29 19:43:19 +02:00
autopilot autopilot: Improve calculation of available funds 2020-10-20 12:45:35 +02:00
backup noise: Add missing dependency on psutil>=5 2020-10-21 16:13:29 +02:00
csvexportpays@e83c6227f3 csvexportpays: Added submodule to export payments as a CSV 2019-07-18 19:21:51 +02:00
donations Update pillow to a secure version 2020-04-04 19:20:03 +02:00
drain drain: fix test for clnd with exp features 2020-09-19 17:00:19 +02:00
feeadjuster feeadjuster: fix typos 2020-11-11 12:00:27 +01:00
graphql@100978bc99 new change to graphql 2019-05-10 17:06:45 +02:00
helpme helpme: Verify that the caller has specified an invoice 2020-08-29 14:54:40 +02:00
jitrebalance jitrebalance: handle the failure of the scid lookup in our peers 2020-10-15 19:35:43 +02:00
jwt-factory@cf90ba3495 updated graphql submodule. Added new jwt-factory submodule 2019-05-10 17:06:45 +02:00
lightning-qt@34d6c990a7 Update lightning-qt (second take) 2019-12-24 22:21:04 +01:00
monitor pytest: Rename start tests to reflect the plugin under test 2019-12-27 17:17:58 +01:00
noise noise: Disabled retry test for being way too flaky 2020-05-18 22:44:49 +02:00
persistent-channels persistent-channels: Use the correct parameter name 2020-05-18 22:44:49 +02:00
probe pytest: Rename start tests to reflect the plugin under test 2019-12-27 17:17:58 +01:00
prometheus prometheus: Change default port to 9750 as per port-allocation 2020-08-29 14:36:03 +02:00
rebalance rebalance: reduce some log output to debug 2020-06-11 13:16:01 +02:00
sauron sauron: handle testnet API unreliability 2020-08-30 10:48:01 +02:00
sendinvoiceless pytest: Rename start tests to reflect the plugin under test 2019-12-27 17:17:58 +01:00
sitzprobe@84347d5519 sitzprobe: Add sitzprobe by @niftynei as a submodule 2019-04-01 18:35:39 +02:00
sparko@465455b505 add trustedcoin, sparko and webhook to the main list. 2020-08-28 15:49:00 +02:00
summary summary: fix persistent peerstate zero leading window 2020-08-03 11:37:10 +02:00
trustedcoin@f8e30236a3 add trustedcoin, sparko and webhook to the main list. 2020-08-28 15:49:00 +02:00
webhook@4b75790011 add trustedcoin, sparko and webhook to the main list. 2020-08-28 15:49:00 +02:00
zmq Update twisted to a secure version 2020-04-04 19:20:03 +02:00
.coveragerc pytest: Get coverage inside and outside plugins working 2020-08-28 23:06:30 +02:00
.gitignore backup: Initial version of the backup plugin 2020-04-12 19:35:21 +02:00
.gitmodules add trustedcoin, sparko and webhook to the main list. 2020-08-28 15:49:00 +02:00
.travis.yml travis: Reorder configurations to run DEVELOPER=1 first 2020-08-28 23:06:30 +02:00
conftest.py pytest: Preparing to run integration tests using pytest 2019-03-30 00:03:16 +01:00
LICENSE Initial commit 2019-01-17 13:16:45 +01:00
pytest.ini pytest: Preparing to run integration tests using pytest 2019-03-30 00:03:16 +01:00
README.md autoreload: Remove the autoreload plugin 2020-10-21 16:13:29 +02:00
sitecustomize.py pytest: Get coverage inside and outside plugins working 2020-08-28 23:06:30 +02:00

Plugins for c-lightning

Community curated plugins for c-lightning.

Build Status

Available plugins

Name Short description
autopilot An autopilot that suggests channels that should be established
boltz-channel-creation A c-lightning plugin for Boltz Channel Creation Swaps
csvexportpays A plugin that exports all payments to a CSV file
donations A simple donations page to accept donations from the web
drain Draining, filling and balancing channels with automatic chunks.
event-websocket Exposes notifications over a Websocket
graphql Exposes the c-lightning API over graphql
invoice-queue Listen to lightning invoices from multiple nodes and send to a redis queue for processing
lightning-qt A bitcoin-qt-like GUI for lightningd
monitor helps you analyze the health of your peers and channels
persistent-channels Maintains a number of channels to peers
probe Regularly probes the network for stability
prometheus Lightning node exporter for the prometheus timeseries server
pruning This plugin manages pruning of bitcoind such that it can always sync
rebalance Keeps your channels balanced
reckless An experimental plugin manager (search/install plugins)
sauron A Bitcoin backend relying on Esplora's API
sendinvoiceless Sends some money without an invoice from the receiving node.
sitzprobe A Lightning Network payment rehearsal utility
sparko RPC over HTTP with fine-grained permissions, SSE and spark-wallet support
summary Print a nice summary of the node status
trustedcoin Replace your Bitcoin Core with data from public block explorers
webhook Dispatches webhooks based from event notifications
zmq Publishes notifications via ZeroMQ to configured endpoints

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.

Automatic plugin initialization

Alternatively, especially when you use multiple plugins, you can copy or symlink all plugin directories into your ~/.lightning/plugins directory. The daemon will load each executeable it finds in sub-directories as a plugin. In this case you don't need to manage all the --plugin=... parameters.

PYTHONPATH and pyln

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:

  • Using pip tools: pip3 install pyln-client pyln-testing
  • Using the PYTHONPATH environment variable to include your clightning's shipped pyln-* libraries:
export PYTHONPATH=/path/to/lightnind/contrib/pyln-client:/path/to/lightnind/contrib/pyln-testing:$PYTHONPATH

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 c-lightning.

Writing a test is as simple as this:

  • The framework will look for unittest filenames starting with test_.
  • The test functions should also start with test_.
from pyln.testing.fixtures import *

pluginopt = {'plugin': os.path.join(os.path.dirname(__file__), "YOUR_PLUGIN.py")}

def test_your_plugin(node_factory, bitcoind):
    l1 = node_factory.get_node(options=pluginopt)
    s = l1.rpc.summary()
    s = l1.rpc.getinfo()
    assert(s['network'] == 'REGTEST')  # or whatever you want to test

Tests are run against pull requests, all commits on master, as well as once ever 24 hours to test against the latest master branch of the c-lightning development tree.

Running tests locally can be done like this: (make sure the PYTHONPATH env variable is correct)

pytest YOUR_PLUGIN/YOUR_TEST.py

Additional dependencies

Additionally, some Python plugins come with a requirements.txt which can be used to install the plugin's dependencies using the pip tools:

pip3 install -r requirements.txt

Note: You might need to also specify the --user command line flag depending on your environment.

More Plugins from the Community

Plugin Builder Resources