Analyse the lightning network graph to find articulation points.
This repo builds a binary that can take a GraphML representation of lightning network graph to generate data points about node centrality, number of articulation points and LN nodes sorted by centrality. These data points are then accessed by a front end to plot various charts. The front end is source code is at https://github.com/kulpreet/ln-metrics
The binary generated here accepts LN graph represented as
GraphML. https://github.com/lightningnetwork/lnd has a cli called
lncli, that can dump the current LN graph as a json file using lncli describegraph.
The json from describegraph is piped through
lightning-network-graphxml
before being processed by the binary generated by this
repo. lightning-network-graphxml converts the json from
describegraph into GraphML syntax that can be then imported into
Boost Graph Library.
For now, we compute centrality, number of biconnected components and the number of articulation points. We also output a list of all LN nodes ordered by node centrality.
Results are meant to be published on a daily metrics page. This page used to be up on lnmetric.opdup.com.
Boost Graph Library, version 1.62.0 or higher
make
./readgraph --help
./readgraph --input [inputfile.xml] --outdir [dirname]
The repo includes some dumps from lncli describe graph in the data
directory. So you can try it out by:
./readgraph --input data/20180824_120001.xml --outdir /tmp/
This will generate a bunch of csv files:
