1

As I understand lightning a node should in principle have a complete view of the lightning network graph (i.e., all nodes and channels). However, I also understand that for practical reasons the view will not actually be fully complete (some update may not have reached the node, I suppose).

For example I am currently using c-lightning. After running a node for some hours, if I do lightning-cli listnodes I get a list of ~5k nodes. But if I look at 1ml.com they currently report that there are ~14k nodes (~7k with active channels). So there seems to be rather a large gap between what I see and what 1ml sees.

For a particular use case I would like to have a "as complete as possible" view, though. My question then is if there is some way to configure the node to more actively explore and learn the full network?

1

lightning-cli listchannels is what you are looking for to also see the channels and not only the nodes.

In general the lightning nodes learn the network view from the gossip protocol where closed channels may be discarded and not forwarded anymore. If you look proprietary tools like the one you mentioned they might have stored older nodes and channels this is one source how the different numbers can arise.

BTW you get the gossip information from your peers so you could also peer with as many nodes as you learn from your initial peers and hope that you get a larger view of gossip.

1
  • So just connecting to many nodes using the lightning-cli connect command should boost the rate at which my node discovers the network? Thanks, that sounds simple enough. – PyrolitePancake Nov 10 '20 at 14:34

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.