I want to study the properties of the Lightning network graph. Is there a way to obtain a reasonably fresh snapshot containing nodes and channels (say, in JSON format)? There are multiple explorers available (e.g. listed in this question), but AFAIK none of them provides the underlying data for download.

(I could just launch my own node and query the data with allnodes / allchannels or a similar command, but that requires synching a non-pruned full node, which I'm trying to avoid at the moment.)

UPD: 1ML does provide some JSON (look for the JSON button on various pages). For example, https://1ml.com/testnet/node?json=true gives the JSON description of the top 50 nodes. I haven't found the way to get this data for all nodes though.

UPD2: a related question: Obtaining Lightning network graph data.


As far as I know currently noone explicitly provides this dataset / snapshot. However romperts recksplorer works with providing this dataset from lnd to the browser and have javascript visualize it. so you could do: wget https://rompert.com/networkgraphv2 but that is a little bit dirty.

The "easiest" way to achieve what you are looking for by doing it properly is probably to extract gossipd from lightningd. As you know c Lightning has this darmonized architecture so there gossipd should be able to run standalone, peer with nodes and download sync the network graph.

I might be interested in helping to run gossipd as a standalone tool. We could also just implement the gossip protocol ourselves as that part of lightning is pretty standalone.

Hope these two suggestions help

  • "gossipd should be able to run standalone" - does this imply that as of now I'd have to tweak the code and re-build c-lightning to be able to launch gossipd separately? – Sergei Tikhomirov Jun 12 '19 at 10:51
  • Yeah. That is exactly what I was trying to say (: in that way you won't need Bitcoind or anything like that but you will just connect to the gossip protocol / peer network – Rene Pickhardt Jun 12 '19 at 11:05
  • 1
    btw you could do wget https://rompert.com/networkgraphv2 | jq '.' | less to download the latest gossip store from rompert's lnd node (I will also edit this to the answer) – Rene Pickhardt Jun 12 '19 at 11:57
  • Wow, that (using rompert.com) is really helpful, thanks a lot! Hope the node maintainers don't mind occasional downloads of their data for research purposes... – Sergei Tikhomirov Jun 12 '19 at 12:57

https://ln.alhur.es/ provides a download link for their historical channel database from this link: https://ln.alhur.es/static/channels.db


There is also this repository on Github: https://github.com/lnresearch/topology

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.