Skip to main content

Utilities to define and bootstrap lightning networks for testing

Project description

lnet -- Simplified Lightning Network Setup

Have you ever tried setting up a small Lightning Network on regtest to develop or demo against, and found it frustrating and confusing? lnet's goal is to make it easy to spin up any network topology for testing or demoing, all you need to do is describe the network in the graphviz dot format.

Take the following example, which will spin up two nodes, called client and server respectively, connect them and fund a channel. It'll also create an invoice on the server to balance the channel by sending over 500'000msat. You describe it, we make it happen.

graph g {
  client -- server [capacity="10000000:500000"];
}

A more complicated setup could be a star topology and some multi-hop paths:

graph g {
  client1 -- server [capacity="10000000"];
  client2 -- server [capacity="10000000"];
  client3 -- server [capacity="10000000"];
  client4 -- server [capacity="10000000"];
  client5 -- server [capacity="10000000"];

  "client5-1" -- client5 [capacity="10000000"];
  "client5-2" -- client5 [capacity="10000000"];
  "client5-3" -- client5 [capacity="10000000"];

}

Installation

lnet is just a simple pip install away:

pip3 install lnet

This will install the lnet-cli and lnet-daemon command line utilities. lnet-daemon starts, monitors and provides access to bitcoind and any number of c-lightning nodes, while lnet-cli is used to interact with the daemon and the nodes.

Usage

All operations are performed through lnet-cli, which will start lnet-daemon if required. lnet-cli has the following commands:

  • start [dotfile] parses the dotfile, extracting nodes and channels, and tries to recreate the desired topology. It'll open channels and confirm them to make the usable, however it currently requires that the network topology is not partitioned. See below for attributes that are defined.
  • stop stops the currently running topology
  • shutdown stops the running topology and shuts down the lnet-daemon
  • node [nodename] [rpc_method] [params...] executes rpc_method on the node with name nodename and the specified params. This is mainly used as a shorthand to give access without having to configure your shell.
  • alias configures your shell with a number of aliases to make it easy to interact with the daemons without going through lnet-cli. You can use it with eval $(lnet-cli alias).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lnet-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

lnet-0.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file lnet-0.0.1.tar.gz.

File metadata

  • Download URL: lnet-0.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for lnet-0.0.1.tar.gz
Algorithm Hash digest
SHA256 47b56673e8e965c4a537e872f2310da0f6b9e462446abfbaff6a3a949623e00a
MD5 1dbf5bbd9111bede7571223cda67fef4
BLAKE2b-256 bbc37bc853a3fd3c2a4f43c04e1a665aaf802f7cb7060ea6a84320d444b25443

See more details on using hashes here.

File details

Details for the file lnet-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lnet-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for lnet-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cf89c0e1c0e95ede2b7e4076d5d5f1958a375ae372080164d8c192986748122
MD5 7ada719736784ef0f7f1808372e59e3a
BLAKE2b-256 d9dae1bc3c6a2f6b39220544698a82711f7ceeadda7d78e3f28821bfcc7d5bcd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page