Spec protocol tests for lightning network implementations
Project description
lnprototest is a set of test helpers written in Python3, designed to make it easy to write new tests when you propose changes to the lightning network protocol, as well as test existing implementations.
Install requirements
To install the necessary dependences
pip3 install poetry
poetry shell
poetry install
Well, now we can run the test
Running test
The simplest way to run is with the "dummy" runner:
make check
Here are some other useful pytest options:
-n8
to run 8-way parallel.-x
to stop on the first failure.--pdb
to enter the debugger on first failure.--trace
to enter the debugger on every test.-k foo
to only run tests with 'foo' in their name.tests/test_bolt1-01-init.py
to only run tests in that file.tests/test_bolt1-01-init.py::test_init
to only run that test.--log-cli-level={LEVEL_NAME}
to enable the logging during the test execution.
Running Against A Real Node.
The more useful way to run is to use an existing implementation. So far, core-lightning is supported. You will need:
bitcoind
installed, and in your path.lightningd
compiled with--enable-developer
. By default the source directory should be../lightning
relative to this directory, otherwise useexport LIGHTNING_SRC=dirname
.- Install any python requirements by
pip3 install -r lnprototest/clightning/requirements.txt
.
Then you can run
make check PYTEST_ARGS='--runner=lnprototest.clightning.Runner'
or directly:
pytest --runner=lnprototest.clightning.Runner
Further Work
If you want to write new tests or new backends, see HACKING.md.
Let's keep the sats flowing!
Rusty.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lnprototest-0.0.6.tar.gz
.
File metadata
- Download URL: lnprototest-0.0.6.tar.gz
- Upload date:
- Size: 72.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.7 Linux/6.6.58-1-lts
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4846bc2cbd3686774746d849fb3eb4031cb38e1b79c6ec0d7771217462fe331a |
|
MD5 | c3a07259adcbc6ee1957aa2ce9ea255c |
|
BLAKE2b-256 | 6c93bd0341ed0bb05ceb1d3e5d005d834716837f13f8b154c7c956251b61141e |
File details
Details for the file lnprototest-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: lnprototest-0.0.6-py3-none-any.whl
- Upload date:
- Size: 79.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.7 Linux/6.6.58-1-lts
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 485b458861ee4d2007a9268d8993e4042b87c11a92d213f67ae5577c3f223fbe |
|
MD5 | 4e973e93307ebd649e841665d0df55d7 |
|
BLAKE2b-256 | c078059fd864a8dcd526185c8faa2e97b50041b81363cb5d9ef7fc3ba4c8d1c0 |