LN Toolkit Command

download-graph’ command

download-graph downloads the Lightning graph and outputs it as JSON.

This is handy for ‘go’ developers, but probably not too many others. Everyone else can use the lncli command to download the graph, but it’s not quite the right format to unmarshal into the ‘go’ lnrpc data structures.

Caveats

You probably don’t want to use this.

Example

Here’s a simple example of running the command:

lntoolkit download-graph --quiet

This will download all the channel edges in the Lightning network that your LND server and output them as JSON.

Usage

Here’s the list of parameters it can take:

Usage of download-graph:
  -certificate string
    	path and filename of the TLS certificate to use when connecting to LND. (default "~/.lnd/tls.cert")
  -macaroon string
    	path and filename of the macaroon to use when connecting to LND. (default "~/.lnd/data/chain/bitcoin/testnet/admin.macaroon")
  -quiet
    	only show errors and critical messages.
  -server string
    	hostname and port to use when connecting to LND. (default "localhost:10009")
  -timeout duration
    	timeout to use when connecting to LND. (default 30s)
  -tip value
    	tip amount (in satoshis) to the developer as a thank-you (Tip is only paid if an action is performed.)
  -verbose
    	show additional logging information.
  -version
    	report the version being used.

Like all LN Toolkit commands, download-graph can take a --verbose flag to greatly increase the amount of diagnostic output it creates (including JSON representations of routes, if you like that kind of thing). It can also take a --tip <amount> parameter if you want to tip me some satoshis.