0

My lnd node died but I'm doing some research on lightning channels. So I'm rebuilding a new btc/lnd node, but in the meantime: are there open nodes that I can access, especially for SubscribeChannelGraph?

Update: I found this repo that pretty much had everything I needed. It's a modular implementation of the BOLT specification in NodeJS, meant exactly for uses cases like mine.

https://github.com/altangent/lntools

2

As far as I know there are no open nodes anywhere. But I have not been searching for them. Generally you don't need a full node / a full implementation to get the data from the lnd command subscribechannelgraph.

Basically you will only need to reimplement BOLT 07 ( https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md ) to listen to the gossip protocol.

However since the transport layer in BOLT 08 is encrypted via the noise protocol framework you will also have to reimplement this in order to be able to connect to a peer. Only your peers can be queried for the network graph from BOLT 07. The only other BOLT that you need is BOLT 01 which describes the message format of peer messages.

Implementing these allows you to interact with the peer to peer network and get information about the channel graph without the necessity to implement a full lightning node or even run a Bitcoin node. In fact you don't even need any of the Bitcoin techstack (just ecdsa for your static node key and strong authentication within BOLT 08)

I might make the network graph available via my lightning node next weekend if I remember to do so. Then there would be an open api command to query for this data. Hope that answer helped.

  • 2
    Should make the distinction between a peer you're simply connected to, and a peer which you have channels with. There is no requirement to have channels open to gossip, so implementation of BOLT2 is not strictly necessary. When you first run a lightning node it will perform the initial gossip sync, I believe before any channels are opened. You need channels if you wish to advertise your own node on the gossip network, in which case you would need to then implement BOLT2. – Mark H Apr 28 at 19:02
  • 1
    Yes true! I was not precise. No need for entire BOLT 02 but necessity to connect to the peer wich I thought I remembered was part of BOLT 2. Since I was on mobile I didn't double check. Will edit the answer now. Thanks for paying attention (: – Rene Pickhardt Apr 28 at 19:49
  • As far a solutions go, it's a tall order... That being said, I really like the idea of it. It really fits my research to be able to "mess" with the gossip, without having to run a full node. I'm think I'll dive into this a bit. I'm undecided on the programming language to use. C seems logical, because of c-lightning, Python seems logical mainly because of academia, Go seems logical because of LND (which I like a lot) but I have no experience in the latter. Any thoughts? (I will mark this answer as accepted in a few days, but I keep it open for now to encourage others to answer as well) – gijswijs Apr 29 at 2:21
  • 1
    You know in the electrum repository there there is a lightning branch with an almost complete implementation of the lightning rfc in python. So it might make sense to extract the gossip code from there – Rene Pickhardt Apr 29 at 6:40

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.