<p>So in c-lightning you have the two api calls <code>listnodes</code> and <code>listchannels</code></p>

<p>here are sample outputs from a mainnet c-lightning nodes: </p>

<pre><code>"channels": [
    {
      "source": "0250373555232cec757ea141273e75381c84cc3ab22f1e3a3ca5a2dc55b1904c24", 
      "destination": "02ef61a252f9504a42fc264a28476f44cea0711a44b2da0bd729ad52aaee9d86b7", 
      "short_channel_id": "505149x622x0", 
      "public": true, 
      "satoshis": 300000, 
      "amount_msat": "300000000msat", 
      "message_flags": 1, 
      "channel_flags": 0, 
      "flags": 256, 
      "active": true, 
      "last_update": 1559441480, 
      "base_fee_millisatoshi": 1000, 
      "fee_per_millionth": 10, 
      "delay": 14
    }
</code></pre>

<p>and</p>

<pre><code>"nodes": [
    {
      "nodeid": "039f96b5dc60b60596dafc870ae104beb6cfaa40aa718b3e9dab9db6b1e52ed3b8", 
      "alias": "DACSC", 
      "color": "3399ff", 
      "last_timestamp": 1559456735, 
      "globalfeatures": "", 
      "global_features": "", 
      "addresses": [
        {
          "type": "ipv4", 
          "address": "92.86.218.107", 
          "port": 9735
        }
      ]
    }
</code></pre>

<p>on the other side if you use lnd there ist the <code>listnetwork</code> command which prints a large json blob which has two fields <code>nodes</code> and <code>edges</code></p>

<p>for a random node the entrie looks like that: </p>

<pre><code>"nodes": [
    {
      "last_update": 1559598407,
      "pub_key": "0200072fd301cb4a680f26d87c28b705ccd6a1d5b00f1b5efd7fe5f998f1bbb1f1",
      "alias": "OutaSpace ",
      "addresses": [
        {
          "network": "tcp",
          "addr": "46.163.78.93:9760"
        },
        {
          "network": "tcp",
          "addr": "[2a01:488:66:1000:2ea3:4e5d:0:1]:9760"
        },
        {
          "network": "tcp",
          "addr": "2dkobxxunnjatyph.onion:9760"
        },
        {
          "network": "tcp",
          "addr": "nzslu33ecbokyn32teza2peiiiuye43ftom7jvnuhsxdbg3vhw7w3aqd.onion:9760"
        }
      ],
      "color": "#123456"
    },
</code></pre>

<p>and for a random channel it looks like that: </p>

<pre><code>{
    "channel_id": "564791635544965120",
    "chan_point": "4297b5fe9beeb701c67fd0f84861b22edbcafe5c25be67324ab11129226356a1:0",
    "last_update": 1552879381,
    "node1_pub": "028aa5a991a2acf33da91674fe062219b640e5e57d77a48de6df3c0d30be22b05b",
    "node2_pub": "03fab7f8655169ea77d9691d4bd359e97782cb6177a6f76383994ed9c262af97a5",
    "capacity": "50000",
    "node1_policy": {
      "time_lock_delta": 14,
      "min_htlc": "1000",
      "fee_base_msat": "1000",
      "fee_rate_milli_msat": "10",
      "disabled": false,
      "max_htlc_msat": "0"
    },
    "node2_policy": {
      "time_lock_delta": 144,
      "min_htlc": "0",
      "fee_base_msat": "1000",
      "fee_rate_milli_msat": "1",
      "disabled": true,
      "max_htlc_msat": "50000000"
    }
  },
</code></pre>

<p>so you see the information is in all cases <code>eclair</code>, <code>lnd</code> and <code>c-lightning</code> pretty much the one from bolt 07 and the gossip protocol. just the formatting is different. There are slight changes with also showing signatures of messages but the core info is the same.</p>

CC BY-SA 4.0
2019-06-12T11:55:58.093Z
2019-06-12T11:55:58.093Z
Rene Pickhardt
<p>I want to obtain a fresh snapshot of the Lightning network from my own node. So far I've experimented with Eclair, its API calls <code>allnodes</code>, <code>allchannels</code>, and <code>allupdates</code> give me the information in the following format (examples from testnet).</p>

<p>A node:</p>

<pre><code>{
    "signature": "304502210091f498ae307be653c3dc54954e4e20fcf1a42ff6f0ff7cfe9f1b4367f64349f2022069931b88e1a05cf16ebd08a7272f2249ec47816c9bda51d7b1b4c70b35ed580001",
    "features": "",
    "timestamp": 1543424260,
    "nodeId": "03be1602dd945198ad92b96ed6de85ba41d6c69cc5e81826d5d05a176bf9a38fcd",
    "rgbColor": "#e20f00",
    "alias": "shangod1933e2a-3f17-4",
    "addresses": [
      "54.242.15.59:9735"
    ]
  },
</code></pre>

<p>A channel:</p>

<pre><code>{
    "shortChannelId": "1288195x260x0",
    "a": "02ece82b43452154392772d63c0a244f1592f0d29037c88020118889b76851173f",
    "b": "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134"
  },
</code></pre>

<p>An update:</p>

<pre><code>{
    "signature": "3045022100fb115950efdeb745d16e79b13be18d01a02c66f2bad0a2050ac157f70e51fe9502201694b2ff817bd5a1bc44488e9732e233f2ca93528df5cbe134ecc2555e7b2a5601",
    "chainHash": "43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000",
    "shortChannelId": "1448407x42x1",
    "timestamp": 1560197957,
    "messageFlags": 1,
    "channelFlags": 0,
    "cltvExpiryDelta": 144,
    "htlcMinimumMsat": 1000,
    "feeBaseMsat": 1000,
    "feeProportionalMillionths": 1,
    "htlcMaximumMsat": 16777215000
  },
</code></pre>

<p>Do other implementations (LND, c-lightning) provide the same information (maybe in a different format)? If I want to get the most available information about nodes and channels, should I stick with Eclair or switch to another implementation?</p>

<lightning-network>
What is the best Lightning implementation to obtain the network graph?
Sergei Tikhomirov
# What is the best Lightning implementation to obtain the network graph?

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

I want to obtain a fresh snapshot of the Lightning network from my own node. So far I've experimented with Eclair, its API calls `allnodes`, `allchannels`, and `allupdates` give me the information in the following format (examples from testnet).

A node:

```
{
    "signature": "304502210091f498ae307be653c3dc54954e4e20fcf1a42ff6f0ff7cfe9f1b4367f64349f2022069931b88e1a05cf16ebd08a7272f2249ec47816c9bda51d7b1b4c70b35ed580001",
    "features": "",
    "timestamp": 1543424260,
    "nodeId": "03be1602dd945198ad92b96ed6de85ba41d6c69cc5e81826d5d05a176bf9a38fcd",
    "rgbColor": "#e20f00",
    "alias": "shangod1933e2a-3f17-4",
    "addresses": [
      "54.242.15.59:9735"
    ]
  },

```

A channel:

```
{
    "shortChannelId": "1288195x260x0",
    "a": "02ece82b43452154392772d63c0a244f1592f0d29037c88020118889b76851173f",
    "b": "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134"
  },

```

An update:

```
{
    "signature": "3045022100fb115950efdeb745d16e79b13be18d01a02c66f2bad0a2050ac157f70e51fe9502201694b2ff817bd5a1bc44488e9732e233f2ca93528df5cbe134ecc2555e7b2a5601",
    "chainHash": "43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000",
    "shortChannelId": "1448407x42x1",
    "timestamp": 1560197957,
    "messageFlags": 1,
    "channelFlags": 0,
    "cltvExpiryDelta": 144,
    "htlcMinimumMsat": 1000,
    "feeBaseMsat": 1000,
    "feeProportionalMillionths": 1,
    "htlcMaximumMsat": 16777215000
  },

```

Do other implementations (LND, c-lightning) provide the same information (maybe in a different format)? If I want to get the most available information about nodes and channels, should I stick with Eclair or switch to another implementation?

**Tags:** lightning-network


---

## 1 answers

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

So in c-lightning you have the two api calls `listnodes` and `listchannels`

here are sample outputs from a mainnet c-lightning nodes:

```
"channels": [
    {
      "source": "0250373555232cec757ea141273e75381c84cc3ab22f1e3a3ca5a2dc55b1904c24", 
      "destination": "02ef61a252f9504a42fc264a28476f44cea0711a44b2da0bd729ad52aaee9d86b7", 
      "short_channel_id": "505149x622x0", 
      "public": true, 
      "satoshis": 300000, 
      "amount_msat": "300000000msat", 
      "message_flags": 1, 
      "channel_flags": 0, 
      "flags": 256, 
      "active": true, 
      "last_update": 1559441480, 
      "base_fee_millisatoshi": 1000, 
      "fee_per_millionth": 10, 
      "delay": 14
    }

```

and

```
"nodes": [
    {
      "nodeid": "039f96b5dc60b60596dafc870ae104beb6cfaa40aa718b3e9dab9db6b1e52ed3b8", 
      "alias": "DACSC", 
      "color": "3399ff", 
      "last_timestamp": 1559456735, 
      "globalfeatures": "", 
      "global_features": "", 
      "addresses": [
        {
          "type": "ipv4", 
          "address": "92.86.218.107", 
          "port": 9735
        }
      ]
    }

```

on the other side if you use lnd there ist the `listnetwork` command which prints a large json blob which has two fields `nodes` and `edges`

for a random node the entrie looks like that:

```
"nodes": [
    {
      "last_update": 1559598407,
      "pub_key": "0200072fd301cb4a680f26d87c28b705ccd6a1d5b00f1b5efd7fe5f998f1bbb1f1",
      "alias": "OutaSpace ",
      "addresses": [
        {
          "network": "tcp",
          "addr": "46.163.78.93:9760"
        },
        {
          "network": "tcp",
          "addr": "[2a01:488:66:1000:2ea3:4e5d:0:1]:9760"
        },
        {
          "network": "tcp",
          "addr": "2dkobxxunnjatyph.onion:9760"
        },
        {
          "network": "tcp",
          "addr": "nzslu33ecbokyn32teza2peiiiuye43ftom7jvnuhsxdbg3vhw7w3aqd.onion:9760"
        }
      ],
      "color": "#123456"
    },

```

and for a random channel it looks like that:

```
{
    "channel_id": "564791635544965120",
    "chan_point": "4297b5fe9beeb701c67fd0f84861b22edbcafe5c25be67324ab11129226356a1:0",
    "last_update": 1552879381,
    "node1_pub": "028aa5a991a2acf33da91674fe062219b640e5e57d77a48de6df3c0d30be22b05b",
    "node2_pub": "03fab7f8655169ea77d9691d4bd359e97782cb6177a6f76383994ed9c262af97a5",
    "capacity": "50000",
    "node1_policy": {
      "time_lock_delta": 14,
      "min_htlc": "1000",
      "fee_base_msat": "1000",
      "fee_rate_milli_msat": "10",
      "disabled": false,
      "max_htlc_msat": "0"
    },
    "node2_policy": {
      "time_lock_delta": 144,
      "min_htlc": "0",
      "fee_base_msat": "1000",
      "fee_rate_milli_msat": "1",
      "disabled": true,
      "max_htlc_msat": "50000000"
    }
  },

```

so you see the information is in all cases `eclair`, `lnd` and `c-lightning` pretty much the one from bolt 07 and the gossip protocol. just the formatting is different. There are slight changes with also showing signatures of messages but the core info is the same.


---

