Metadata-Version: 2.1
Name: lnprototest
Version: 0.0.5
Summary: Spec protocol tests for lightning network implementations
License: MIT
Author: Rusty Russell
Author-email: rusty@blockstream.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: crc32c (>=2.2.post0,<3.0)
Requires-Dist: pyln-bolt1 (>=1.0.222,<2.0.0)
Requires-Dist: pyln-bolt2 (>=1.0.222,<2.0.0)
Requires-Dist: pyln-bolt4 (>=1.0.222,<2.0.0)
Requires-Dist: pyln-bolt7 (>=1.0.246,<2.0.0)
Requires-Dist: pyln-client (>=0.12.0,<0.13.0)
Requires-Dist: pyln-proto (>=23.05.2,<24.0.0)
Requires-Dist: pyln-testing (>=0.12.0,<0.13.0)
Requires-Dist: python-bitcoinlib (>=0.11.2,<0.12.0)
Description-Content-Type: text/markdown

<div align="center">
  <h1>lnprototest</h1>

  <p>
    <strong>a Testsuite for the Lightning Network Protocol</strong>
  </p>

  <h4>
    <a href="https://github.com/rustyrussell/lnprototest">Project Homepage</a>
  </h4>
 
  <a href="https://github.com/rustyrussell/lnprototest/actions">
    <img alt="GitHub Workflow Status (branch)" src="https://img.shields.io/github/workflow/status/rustyrussell/lnprototest/Integration%20testing/master?style=flat-square"/>
  </a>
  
  <a href="https://github.com/vincenzopalazzo/lnprototest/blob/vincenzopalazzo/styles/HACKING.md">
    <img src="https://img.shields.io/badge/doc-hacking-orange?style=flat-square" />
  </a>

</div>

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

```bash
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:

1. `-n8` to run 8-way parallel.
2. `-x` to stop on the first failure.
3. `--pdb` to enter the debugger on first failure.
4. `--trace` to enter the debugger on every test.
5. `-k foo` to only run tests with 'foo' in their name.
6. `tests/test_bolt1-01-init.py` to only run tests in that file.
7. `tests/test_bolt1-01-init.py::test_init` to only run that test.
8. `--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:

1. `bitcoind` installed, and in your path.
2. [`lightningd`](https://github.com/ElementsProject/lightning/) compiled with
   `--enable-developer`. By default the source directory should be
   `../lightning` relative to this directory, otherwise use
   `export LIGHTNING_SRC=dirname`.
3. 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](HACKING.md).

Let's keep the sats flowing!

Rusty.

