alexbosworth / ln-service

Node.js interface to LND
MIT License
319 stars 60 forks source link

How to know if the connection is established succesfully? #181

Open basharov opened 10 months ago

basharov commented 10 months ago

I am building a diagnostic procedure to check multiple running parts of my app. One of them is LND instance, and before running the app I run the procedure and see the status of all parts.

How do I know that LND instance is reachable and authenticated succesfully?

My startpoint is:

const { lnd } = authenticatedLndGrpc(MY_CONFIG)

But by looking into lnd, I don't see any clue. So, when it connects, or doesn't connect (due to LND is down), I don't see any sign of any. I know I can run some method like getChainBalance({ lnd }), to know if commands go through, but is there some other more basic option?

alexbosworth commented 10 months ago

You could use the verifyAccess method?

But to verify reachability then yeah you'd want to try reaching the node

basharov commented 10 months ago

But to verify reachability then yeah you'd want to try reaching the node

To check reachability I use node-nmap and it seems to do the job. Thanks for the advice!