<p><strong>UPDATE (march 2022):</strong></p>
<p>The lnresearch repository has historic snapshots at <a href="https://github.com/lnresearch/topology" rel="nofollow noreferrer">https://github.com/lnresearch/topology</a> (as pointed out in <a href="https://bitcoin.stackexchange.com/a/105358/81940">the other answer by damianodamiano</a> )</p>
<p>if you want a recent snapshot you can use c-lightning and run:</p>
<pre><code>lightning-cli listchannels &gt; your_channel_file.json
</code></pre>
<p>of course the later requires you to first connect to some other nodes and sync gossip.</p>
<p><strong>Old reply:</strong></p>
<p>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: <code>wget https://rompert.com/networkgraphv2</code> but that is a little bit dirty.</p>
<p>The &quot;easiest&quot; way to achieve what you are looking for by doing it properly is probably to extract <code>gossipd</code> from <code>lightningd</code>. 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.</p>
<p>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.</p>
<p>Hope these two suggestions help</p>

CC BY-SA 4.0
2019-06-12T10:51:16.187Z
"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
CC BY-SA 4.0
2019-06-12T11:05:23.447Z
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
CC BY-SA 4.0
2019-06-12T11:57:33.063Z
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
CC BY-SA 4.0
2019-06-12T12:57:36.037Z
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
CC BY-SA 4.0
2022-03-23T09:06:07.547Z
Any update to this question? the rompert.com website seems unreachable. Is there any alternative?
damianodamiano
CC BY-SA 4.0
2022-03-24T11:25:42.807Z
just edited my answer and provided a more stable link to : https://github.com/lnresearch/topology (as pointed out by damianodamiano sorry oversaw it!)
Rene Pickhardt
CC BY-SA 4.0
2019-06-12T10:41:22.100Z
2022-03-24T11:28:00.390Z
2022-03-24T11:28:00.390Z
Rene Pickhardt
<p><a href="https://ln.alhur.es/" rel="nofollow noreferrer">https://ln.alhur.es/</a> provides a download link for their historical channel database from this link: <a href="https://ln.alhur.es/static/channels.db" rel="nofollow noreferrer">https://ln.alhur.es/static/channels.db</a></p>

CC BY-SA 4.0
2019-08-31T04:13:10.783Z
2019-08-31T04:13:10.783Z
pseudozach
<p>There is also this repository on Github: <a href="https://github.com/lnresearch/topology" rel="nofollow noreferrer">https://github.com/lnresearch/topology</a></p>

CC BY-SA 4.0
2021-04-12T06:58:38.603Z
2021-04-12T06:58:38.603Z
damianodamiano
<p>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 <a href="https://bitcoin.stackexchange.com/q/85460/31712">this question</a>), but AFAIK none of them provides the underlying data for download.</p>
<p>(I could just launch my own node and query the data with <code>allnodes</code> / <code>allchannels</code> or a similar command, but that requires synching a non-pruned full node, which I'm trying to avoid at the moment.)</p>
<p>UPD: 1ML does provide <em>some</em> JSON (look for the JSON button on various pages). For example, <a href="https://1ml.com/testnet/node?json=true" rel="nofollow noreferrer">https://1ml.com/testnet/node?json=true</a> gives the JSON description of the top 50 nodes. I haven't found the way to get this data for all nodes though.</p>
<p>UPD2: a related question: <a href="https://bitcoin.stackexchange.com/questions/76189/obtaining-lightning-network-graph-data">Obtaining Lightning network graph data</a>.</p>

<lightning-network>
Where can I download a snapshot of the Lightning network topology?
Sergei Tikhomirov
# Where can I download a snapshot of the Lightning network topology?

(Asked by: username_0 on 2019-06-12)

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](https://bitcoin.stackexchange.com/q/85460/31712)), 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](https://bitcoin.stackexchange.com/questions/76189/obtaining-lightning-network-graph-data).

**Tags:** lightning-network


---

## 3 answers

### Answer by username_1 on 2019-06-12. Score: 2 | Accepted answer

UPDATE (march 2022):
The lnresearch repository has historic snapshots at https://github.com/lnresearch/topology (as pointed out in the other answer by username_2 )
if you want a recent snapshot you can use c-lightning and run:
lightning-cli listchannels > your_channel_file.json

of course the later requires you to first connect to some other nodes and sync gossip.
Old reply:
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

> **Comments:**
> **username_0**: "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?  
> **username_1**: 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  
> **username_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)  
> **username_0**: 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...  
> **username_2**: Any update to this question? the rompert.com website seems unreachable. Is there any alternative?  
> **username_1**: just edited my answer and provided a more stable link to : https://github.com/lnresearch/topology (as pointed out by username_2 sorry oversaw it!)  

---

### Answer by username_3 on 2019-08-31. Score: 0

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


---

### Answer by username_2 on 2021-04-12. Score: 0

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


---

