This commit is contained in:
Shannon Appelcline 2020-10-13 09:48:45 -10:00 committed by GitHub
parent bdc21d4d32
commit 9fb3d85a54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,32 +2,33 @@
> :information_source: **NOTE:** This is a draft in progress, so that I can get some feedback from early reviewers. It is not yet ready for learning. > :information_source: **NOTE:** This is a draft in progress, so that I can get some feedback from early reviewers. It is not yet ready for learning.
Before you start playing with Lightning Network, you may always want to come to a better understanding of your setup. Before you begin accessing the Lightning Network, you should come to a better understanding of your setup.
## Know Your c-lightning Directory ## Knowing Your c-lightning Directory
To start with, you should understand where everything is kept: the `~/.lightning` directory. Everything is kept in the `~/.lightning` directory.
The main directory just contains as many networks as configured, in this case we have testnet directory.
The main directory just contains directories for whichever networks are configured, in this case testnet:
``` ```
c$ ls ~/.lightning $ ls ~/.lightning
testnet testnet
``` ```
In your ~/.lightning/testnet directory, you'll find that contains all of the guts: The `~/.lightning/testnet directory` will then contains all of the guts of your setup:
``` ```
c$ ls ~/.lightning/testnet3 $ ls ~/.lightning/testnet3
config gossip_store hsm_secret lightningd.sqlite3 lightningd.sqlite3-journal lightning-rpc config gossip_store hsm_secret lightningd.sqlite3 lightningd.sqlite3-journal lightning-rpc
``` ```
> :link: **TESTNET vs MAINNET:** If you're using mainnet, then _everything_ will instead be placed in the main `~/.lightning/bitcoin` directory. These various setups _do_ elegantly stack, so if you are using mainnet, testnet, and regtest, you'll find that `~/.lightning/bitcoin` contains your config file and your mainnet data, the `~/.lightning/testnet` directory contains your testnet data, and the `~/.lightning/regtest` directory contains your regtest data. > :link: **TESTNET vs MAINNET:** If you're using mainnet, then _everything_ will instead be placed in the main `~/.lightning/bitcoin` directory. These various setups _do_ elegantly stack, so if you are using mainnet, testnet, and regtest, you'll find that `~/.lightning/bitcoin` contains your config file and your mainnet data, the `~/.lightning/testnet` directory contains your testnet data, and the `~/.lightning/regtest` directory contains your regtest data.
## Know Your lightning-cli Commands ## Knowing Your lightning-cli Commands
Most of your early work will be done with the `lightning-cli` command, which offers an easy interface to `lightningd`. Most of your early work will be done with the `lightning-cli` command, which offers an easy interface to `lightningd`, just like `bitcoin-cli` does.
You've already seen that the `help` command will gives you a list of other commands:
``` ```
c$ lightning-cli help $ lightning-cli help
lightning-cli: WARNING: default network changing in 2020: please set network=testnet in config! lightning-cli: WARNING: default network changing in 2020: please set network=testnet in config!
=== bitcoin === === bitcoin ===
@ -227,29 +228,28 @@ dev-rescan-outputs
run `lightning-cli help <command>` for more information on a specific command run `lightning-cli help <command>` for more information on a specific command
``` ```
## Optional: Know your lightning lnfo ## Knowing your Lightning Info
A variety of lightning-cli commands can give you additional information on your lightning node. The most general ones are: A variety of `lightning-cli` commands can give you additional information on your lightning node. The most general ones are:
``` ```
c$ lightning-cli listconfigs $ lightning-cli listconfigs
c$ lightning-cli listfunds $ lightning-cli listfunds
c$ lightning-cli listtransactions $ lightning-cli listtransactions
c$ lightning-cli listinvoices $ lightning-cli listinvoices
c$ lightning-cli listnodes $ lightning-cli listnodes
``` ```
* listconfigs: The listconfigs RPC command to list all configuration options with members reflecting the corresponding lightningd-config. * listconfigs: The `listconfigs` RPC command lists all configuration options.
* listfunds: The listfunds RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels. * listfunds: The `listfunds` RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels.
* listtransactions: The listtransactions command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. * listtransactions: The `listtransactions` RPC command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels.
* listinvoices: The listinvoices RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument. * listinvoices: The `listinvoices` RPC command retrievers the status of a specific invoice, if it exists, or the status of all invoices if given no argument.
* listnodes: The listnodes command returns nodes the node has learned about via gossip messages, or a single one if the node id was specified. * listnodes: The `listnodes` RPC command returns nodes that your server has learned about via gossip messages, or a single one if the node id was specified.
For example `lightning-cli listconfigs` gives you a variety of information on your setup: For example `lightning-cli listconfigs` gives you a variety of information on your setup:
``` ```
c$ lightning-cli --network=testnet listconfigs c$ lightning-cli --network=testnet listconfigs
{ {
"# version": "v0.8.2-398-g869fa08", "# version": "v0.8.2-398-g869fa08",
"lightning-dir": "/home/user/.lightning", "lightning-dir": "/home/standup/.lightning",
"network": "testnet", "network": "testnet",
"allow-deprecated-apis": true, "allow-deprecated-apis": true,
"rpc-file": "lightning-rpc", "rpc-file": "lightning-rpc",