Skip to content


Repository files navigation


This repository is a collection of handy Python scripts for lightning node management. More scripts will be added over time.

Available scripts     LX Identify your least effective channels. WIP.         Check an lnd.conf file for some simple recommendations.         L  Check for recent keysends with metadata.  X Find nodes that maximize centrality to improve routing.             Some box&whisker plots of node data.      L  Heatmap of recent forwarding activity.         Summarize a node's fee policy vs neighbours.      L  A basic script for setting fees and HTLC size.   L  Human-readable log and CSV of HTLC events in real time.

L - Requires a connection to LND
X - CPU intensive, do not run on node hardware.

Individual documentation for each script is contained in the top section of each file.



Download the repository

$ git clone

Change into the new directory

$ cd lndpytools

Install requirements

$ pip3 install -r requirements.txt --user

(The --user flag avoids conflicts with python libs installed by your system)


Most scripts use gRPC to connect to lnd directly after some setup, create the config file with

$ python3

Double check node.conf and rerun nodeinterface, it will say Connected to node <alias> if everything is correct

With describegraph.json

Instead of connecting to lnd, some scripts can use a fresh copy of describegraph.json in the lndpytools directory. The json file will be preferred over connecting to LND where possible. Create this file from lnd with

$ lncli describegraph > describegraph.json


You are now ready to run the scripts like so

$ python3


You can download updates to the repo with

$ git pull

Tor proxy for lookups

The script uses for information on other nodes. To use use Tor to access information use the ALL_PROXY environment variable. For example:

$ ALL_PROXY="socks5://localhost:9050"


All scripts are based on or

NodeInterface provides an introspective thin wrapper around the LND gRPC API. It tries to be faithful to the official docs while being much less verbose. Many calls are still unsupported, work in progress.

lnGraph provides an interface for loading LN graph data from a JSON file or LND into NetworkX or iGraph. For computationally intense centrality measures, the fastcentrality module can translate a NetworkX graph into iGraph for improved performance.


Collection of Python scripts for managing LND