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:
-n8to run 8-way parallel.-xto stop on the first failure.--pdbto enter the debugger on first failure.--traceto enter the debugger on every test.-k footo only run tests with 'foo' in their name.tests/test_bolt1-01-init.pyto only run tests in that file.tests/test_bolt1-01-init.py::test_initto 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:
bitcoindinstalled, and in your path.lightningdcompiled with--enable-developer. By default the source directory should be../lightningrelative 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.
Metadata
Release files for lnprototest 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lnprototest-0.0.7.tar.gz | 73.1 kB | Without provenance | Details for lnprototest-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lnprototest-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for lnprototest-0.0.7-py3-none-any.whl |
Total release size: 153.4 kB
Release files / lnprototest-0.0.7.tar.gz
| Download URL | lnprototest-0.0.7.tar.gz |
|---|---|
| Size | 73.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3b1a536e6ca95762b67484270176c7704767aea89410f2c34794a3799b40db7
|
|
BLAKE2b-256 checksum How to use checksums |
72f6e342252448da60c2221cedb1342a3c6547163c37b9aa17cdab4d67b47855
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.7 Darwin/24.3.0
|
Release files / lnprototest-0.0.7-py3-none-any.whl
| Download URL | lnprototest-0.0.7-py3-none-any.whl |
|---|---|
| Size | 80.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6725435738b8594cb748ea995f978e45b519223f268da5980a549be97ea87335
|
|
BLAKE2b-256 checksum How to use checksums |
12e470cc01b70156b6b867c44e342dc4024f33664cb023c13e1a757ab26d7c59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.7 Darwin/24.3.0
|
Security for lnprototest 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.