No description
Find a file
Michael Schmoock 01b075117f summary: set thread loglevel to just warn
using level error caused the testframework to fail on non-essential
price or availability thread log messages.

likely caused by the test runner not being able to query the bitstamp
API.
2020-08-01 17:03:41 +02:00
.travis travis: Try to get coverage reporting inside the plugins working 2020-05-27 12:34:57 +02:00
autopilot don't fund channels with more than 16777215sat, don't require confs on UTXOs to fund a channel 2020-06-11 13:17:34 +02:00
autoreload autoreload: Abort if we can't locate the child plugin 2020-05-18 22:44:49 +02:00
backup backup: Perform preflight checks before entering the plugin loop 2020-05-18 22:44:49 +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: refine tests 2020-06-11 13:16:01 +02:00
graphql@100978bc99 new change to graphql 2019-05-10 17:06:45 +02:00
helpme helpme: fix out of range access in configfile parser 2020-05-08 18:16:17 +02:00
jitrebalance jitrebalance: don't set result twice when we can't have a reverse chan 2020-06-02 11:59:12 +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: give short channel id for scid fiels, not long one 2020-06-05 17:54:28 +02:00
rebalance rebalance: reduce some log output to debug 2020-06-11 13:16:01 +02:00
sauron sauron: add Tor proxy support 2020-06-11 15:36:40 +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
summary summary: set thread loglevel to just warn 2020-08-01 17:03:41 +02:00
zmq Update twisted to a secure version 2020-04-04 19:20:03 +02:00
.gitignore backup: Initial version of the backup plugin 2020-04-12 19:35:21 +02:00
.gitmodules csvexportpays: Change git URL to non-authenticated https scheme 2019-12-09 14:31:14 +01:00
.travis.yml coverage: Switch to codecov.io 2020-01-25 20:52:25 +01: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 Update README.md 2020-07-03 11:42:19 +02:00

Plugins for c-lightning

Community curated plugins for c-lightning.

Build Status Coverage Status

Available plugins

Name Short description
autopilot An autopilot that suggests channels that should be established
autoreload A developer plugin that reloads a plugin under development when it changes
csvexportpays A plugin that exports all payments to a CSV file
donations A simple donations page to accept donations from the web
[drain][drain] Draining, filling and balancing channels with automatic chunks.
graphql Exposes the c-lightning API over graphql
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
summary Print a nice summary of the node status
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