mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
doc+README: document config options
This commit is contained in:
parent
9a0315130d
commit
a27eb1d909
3 changed files with 572 additions and 191 deletions
218
README.md
218
README.md
|
|
@ -40,6 +40,7 @@ archives as well.
|
|||
|
||||
| LiT | LND | Loop | Faraday |
|
||||
| ---------------- | ------------ | ----------- | ------------ |
|
||||
| **v0.2.0-alpha** | v0.11.1-beta | v0.9.0-beta | v0.2.1-alpha |
|
||||
| **v0.1.1-alpha** | v0.11.0-beta | v0.8.1-beta | v0.2.0-alpha |
|
||||
| **v0.1.0-alpha** | v0.10.3-beta | v0.6.5-beta | v0.2.0-alpha |
|
||||
|
||||
|
|
@ -75,10 +76,10 @@ installed on your machine.
|
|||
Once you have the necessary prerequisites, LiT can be compiled by running the following
|
||||
commands:
|
||||
|
||||
```
|
||||
git clone https://github.com/lightninglabs/lightning-terminal.git
|
||||
cd lightning-terminal
|
||||
make install
|
||||
```shell script
|
||||
$ git clone https://github.com/lightninglabs/lightning-terminal.git
|
||||
$ cd lightning-terminal
|
||||
$ make install
|
||||
```
|
||||
|
||||
This will produce the `litd` executable and add it to your `GOPATH`. The CLI binaries for
|
||||
|
|
@ -94,12 +95,12 @@ since the daemons are now integrated into `lnd`'s GRPC server.
|
|||
|
||||
Examples:
|
||||
|
||||
```
|
||||
loop --rpcserver=localhost:10009 --tlscertpath=$HOME/.lnd/tls.cert --macaroonpath=$HOME/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
|
||||
```shell script
|
||||
$ loop --rpcserver=localhost:10009 --tlscertpath=$HOME/.lnd/tls.cert --macaroonpath=$HOME/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
|
||||
```
|
||||
|
||||
```
|
||||
frcli --rpcserver=localhost:10009 --tlscertpath=$HOME/.lnd/tls.cert --macaroonpath=$HOME/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
|
||||
```shell script
|
||||
$ frcli --rpcserver=localhost:10009 --tlscertpath=$HOME/.lnd/tls.cert --macaroonpath=$HOME/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
|
@ -134,7 +135,7 @@ port 80 without needing to run the daemon as root.
|
|||
> browser-to-server communication. Web browsers will display a warning when using the
|
||||
> self-signed certificate.
|
||||
|
||||
```
|
||||
```text
|
||||
Application Options:
|
||||
--httpslisten= host:port to listen for incoming HTTP/2 connections on (default: 127.0.0.1:8443)
|
||||
--uipassword= the password that must be entered when using the loop UI. use a strong
|
||||
|
|
@ -147,191 +148,26 @@ Application Options:
|
|||
certificate (default: /Users/<username>/Library/Application Support/Lnd/letsencrypt)
|
||||
```
|
||||
|
||||
In addition to the LiT specific parameters, you must also provide configuration to the
|
||||
`lnd`, `loop` and `faraday` daemons. For `lnd`, each flag must be prefixed with `lnd.`
|
||||
(ex: `lnd.lnddir=~/.lnd`). Please see the
|
||||
[sample-lnd.conf](https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf)
|
||||
file for more details on the available parameters. Note that `loopd` and `faraday` will
|
||||
automatically connect to the in-process `lnd` node, so you do not need to provide them
|
||||
with any additional parameters unless you want to override them. If you do override them,
|
||||
be sure to add the `loop.` and `faraday.` prefixes.
|
||||
### Lnd mode
|
||||
|
||||
Here is an example command to start `litd` on testnet with a local `bitcoind` node:
|
||||
Starting with LiT `v0.2.0-alpha`, you now have the choice of either running an
|
||||
`lnd` node in the same process as the UI (which is called the "integrated" `lnd`
|
||||
mode) or connect the UI to an already running `lnd` node (called "remote" mode).
|
||||
|
||||
```
|
||||
$ ./litd \
|
||||
--httpslisten=0.0.0.0:443 \
|
||||
--uipassword=My$trongP@ssword \
|
||||
--letsencrypt \
|
||||
--letsencrypthost=loop.merchant.com \
|
||||
--lnd.lnddir=/root/.lnd \
|
||||
--lnd.alias=merchant \
|
||||
--lnd.externalip=loop.merchant.com \
|
||||
--lnd.rpclisten=0.0.0.0:10009 \
|
||||
--lnd.listen=0.0.0.0:9735 \
|
||||
--lnd.bitcoin.active \
|
||||
--lnd.bitcoin.testnet \
|
||||
--lnd.bitcoin.node=bitcoind \
|
||||
--lnd.bitcoind.rpchost=localhost \
|
||||
--lnd.bitcoind.rpcuser=testnetuser \
|
||||
--lnd.bitcoind.rpcpass=testnetpw \
|
||||
--lnd.bitcoind.zmqpubrawblock=localhost:28332 \
|
||||
--lnd.bitcoind.zmqpubrawtx=localhost:28333 \
|
||||
--lnd.debuglevel=debug \
|
||||
--loop.loopoutmaxparts=5 \
|
||||
--faraday.min_monitored=48h
|
||||
```
|
||||
Because that single decision has an impact on the configuration options that
|
||||
need to be used, the documentation has been split into two parts, each
|
||||
explaining one mode in detail.
|
||||
|
||||
You can also store the configuration in a persistent `lnd.conf` file so you do not need to
|
||||
type in the command line arguments every time you start the server. Just remember to use
|
||||
the appropriate prefixes as necessary.
|
||||
* Lnd mode **"remote"**
|
||||
+ Connect to a remote `lnd` instance, start the rest (the UI, `loop`,
|
||||
`faraday`) in the same process.
|
||||
+ [Please read the `lnd` **remote** mode configuration guide here.](doc/config-lnd-remote.md)
|
||||
+ This is the default mode that is used if the `--lnd-mode=` command line
|
||||
or `lnd-mode=` configuration option is not set explicitly.
|
||||
|
||||
Do not include section headers, such as `[Application Options]` or `[Bitcoin]`, in the
|
||||
config file. Doing so will produce an error on startup.
|
||||
|
||||
Example `lnd.conf`:
|
||||
|
||||
```
|
||||
httpslisten=0.0.0.0:443
|
||||
letsencrypt=1
|
||||
letsencrypthost=loop.merchant.com
|
||||
|
||||
lnd.lnddir=~/.lnd
|
||||
lnd.alias=merchant
|
||||
lnd.externalip=loop.merchant.com
|
||||
lnd.rpclisten=0.0.0.0:10009
|
||||
lnd.listen=0.0.0.0:9735
|
||||
lnd.debuglevel=debug
|
||||
|
||||
lnd.bitcoin.active=1
|
||||
lnd.bitcoin.testnet=1
|
||||
lnd.bitcoin.node=bitcoind
|
||||
|
||||
lnd.bitcoind.rpchost=localhost
|
||||
lnd.bitcoind.rpcuser=testnetuser
|
||||
lnd.bitcoind.rpcpass=testnetpw
|
||||
lnd.bitcoind.zmqpubrawblock=localhost:28332
|
||||
lnd.bitcoind.zmqpubrawtx=localhost:28333
|
||||
|
||||
loop.loopoutmaxparts=5
|
||||
|
||||
faraday.min_monitored=48h
|
||||
|
||||
```
|
||||
|
||||
The default location for the `lnd.conf` file will depend on your operating system:
|
||||
|
||||
- **On MacOS**: `~/Library/Application Support/Lnd/lnd.conf`
|
||||
- **On Linux**: `~/.lnd/lnd.conf`
|
||||
- **On Windows**: `~/AppData/Roaming/Lnd/lnd.conf`
|
||||
|
||||
### Upgrade Existing Nodes
|
||||
|
||||
If you already have existing `lnd`, `loop`, or `faraday` nodes, you can easily upgrade
|
||||
them to the LiT single executable while keeping all of your past data.
|
||||
|
||||
For `lnd`:
|
||||
|
||||
- if you use an `lnd.conf` file for configurations, add the `lnd.` prefix to each of the
|
||||
configuration parameters.
|
||||
|
||||
Before:
|
||||
|
||||
```
|
||||
[Application Options]
|
||||
alias=merchant
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```
|
||||
[Application Options]
|
||||
lnd.alias=merchant
|
||||
```
|
||||
|
||||
- if you use command line arguments for configuration, add the `lnd.` prefix to each
|
||||
argument to `litd`
|
||||
|
||||
Before:
|
||||
|
||||
```
|
||||
$ lnd --lnddir=~/.lnd --alias=merchant ...
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```
|
||||
$ litd lnd.lnddir=~/.lnd --lnd.alias=merchant ...
|
||||
```
|
||||
|
||||
For `loop`:
|
||||
|
||||
- if you use an `loop.conf` file for configurations, copy the parameters into the
|
||||
`lnd.conf` file that `litd` uses, and add the `loop.` prefix to each of the
|
||||
configuration parameters.
|
||||
|
||||
Before: (in `loop.conf`)
|
||||
|
||||
```
|
||||
[Application Options]
|
||||
loopoutmaxparts=5
|
||||
```
|
||||
|
||||
After: (in `lnd.conf`)
|
||||
|
||||
```
|
||||
[Loop]
|
||||
loop.loopoutmaxparts=5
|
||||
```
|
||||
|
||||
- if you use command line arguments for configuration, add the `loop.` prefix to each
|
||||
argument to `litd`
|
||||
|
||||
Before:
|
||||
|
||||
```
|
||||
$ loop --loopoutmaxparts=5 --debuglevel=debug ...
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```
|
||||
$ litd --loop.loopoutmaxparts=5 --loop.debuglevel=debug ...
|
||||
```
|
||||
|
||||
For `faraday`:
|
||||
|
||||
- the standalone `faraday` daemon does not load configuration from a file, but you can now
|
||||
store the parameters into the `lnd.conf` file that `litd` uses. Just add the `faraday.`
|
||||
prefix to each of the configuration parameters.
|
||||
|
||||
Before: (from command line)
|
||||
|
||||
```
|
||||
$ faraday --min_monitored=48h
|
||||
```
|
||||
|
||||
After: (in `lnd.conf`)
|
||||
|
||||
```
|
||||
[Faraday]
|
||||
faraday.min_monitored=48h
|
||||
```
|
||||
|
||||
- if you use command line arguments for configuration, add the `faraday.` prefix to each
|
||||
argument to `litd`
|
||||
|
||||
Before:
|
||||
|
||||
```
|
||||
$ faraday --min_monitored=48h --debuglevel=debug ...
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```
|
||||
$ litd --faraday.min_monitored=48h --faraday.debuglevel=debug...
|
||||
```
|
||||
* Lnd mode **"integrated"**
|
||||
+ Start everything (the UI, `lnd`, `loop`, `faraday`) in one single process.
|
||||
+ [Please read the `lnd` **integrated** mode configuration guide here.](doc/config-lnd-integrated.md)
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
|
|
@ -356,7 +192,7 @@ Client-side logs are disabled by default in production builds. Logging can be tu
|
|||
adding a couple keys to your browser's `localStorage`. Simply run these two JS statements
|
||||
in you browser's DevTools console then refresh the page:
|
||||
|
||||
```
|
||||
```js
|
||||
localStorage.setItem('debug', '*'); localStorage.setItem('debug-level', 'debug');
|
||||
```
|
||||
|
||||
|
|
|
|||
333
doc/config-lnd-integrated.md
Normal file
333
doc/config-lnd-integrated.md
Normal file
|
|
@ -0,0 +1,333 @@
|
|||
# Configuring LiT with integrated lnd node
|
||||
|
||||
The "integrated" mode means that `lnd` is started within the same process as
|
||||
`litd`, alongside the UI server. Once the integrated `lnd` has been unlocked,
|
||||
`litd` then goes ahead and starts `faraday` and `loop` and connects them to the
|
||||
integrated `lnd` node.
|
||||
|
||||
Currently the UI server cannot connect to `loop` or `faraday` daemons that
|
||||
aren't running in the same process. But that feature will also be available in
|
||||
future versions.
|
||||
|
||||
## Use command line parameters only
|
||||
|
||||
In addition to the LiT specific parameters, you must also provide configuration
|
||||
to the `lnd`, `loop` and `faraday` daemons. For `lnd`, each flag must be
|
||||
prefixed with `lnd.` (ex: `lnd.lnddir=~/.lnd`). Please see the
|
||||
[sample-lnd.conf](https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf)
|
||||
file for more details on the available parameters. Note that `loopd` and
|
||||
`faraday` will automatically connect to the in-process `lnd` node, so you do not
|
||||
need to provide them with any additional parameters unless you want to override
|
||||
them. If you do override them, be sure to add the `loop.` and `faraday.`
|
||||
prefixes.
|
||||
|
||||
To see all available command line options, run `litd --help`.
|
||||
|
||||
Here is an example command to start `litd` on testnet with a local `bitcoind`
|
||||
node:
|
||||
|
||||
```shell script
|
||||
$ litd \
|
||||
--httpslisten=0.0.0.0:443 \
|
||||
--uipassword=My$trongP@ssword \
|
||||
--letsencrypt \
|
||||
--letsencrypthost=loop.merchant.com \
|
||||
--lnd-mode=integrated \
|
||||
--lnd.lnddir=/root/.lnd \
|
||||
--lnd.alias=merchant \
|
||||
--lnd.externalip=loop.merchant.com \
|
||||
--lnd.rpclisten=0.0.0.0:10009 \
|
||||
--lnd.listen=0.0.0.0:9735 \
|
||||
--lnd.bitcoin.active \
|
||||
--lnd.bitcoin.testnet \
|
||||
--lnd.bitcoin.node=bitcoind \
|
||||
--lnd.bitcoind.rpchost=localhost \
|
||||
--lnd.bitcoind.rpcuser=testnetuser \
|
||||
--lnd.bitcoind.rpcpass=testnetpw \
|
||||
--lnd.bitcoind.zmqpubrawblock=localhost:28332 \
|
||||
--lnd.bitcoind.zmqpubrawtx=localhost:28333 \
|
||||
--lnd.debuglevel=debug \
|
||||
--loop.loopoutmaxparts=5 \
|
||||
--faraday.min_monitored=48h \
|
||||
--faraday.connect_bitcoin \
|
||||
--faraday.bitcoin.host=localhost \
|
||||
--faraday.bitcoin.user=testnetuser \
|
||||
--faraday.bitcoin.password=testnetpw
|
||||
```
|
||||
|
||||
## Use a configuration file
|
||||
|
||||
You can also store the configuration in a persistent `~/.lit/lit.conf` file, so
|
||||
you do not need to type in the command line arguments every time you start the
|
||||
server. Just remember to use the appropriate prefixes as necessary.
|
||||
|
||||
Make sure you don't add any section headers (the lines starting with `[` and
|
||||
ending with `]`, for example `[Application Options]`) as these don't work with
|
||||
the additional levels of sub configurations. You can replace them with a
|
||||
comment (starting with the `#` character) to get the same grouping effect as
|
||||
before.
|
||||
|
||||
Example `~/.lit/lit.conf`:
|
||||
|
||||
```text
|
||||
# Application Options
|
||||
httpslisten=0.0.0.0:443
|
||||
letsencrypt=true
|
||||
letsencrypthost=loop.merchant.com
|
||||
lnd-mode=integrated
|
||||
|
||||
# Lnd
|
||||
lnd.lnddir=~/.lnd
|
||||
lnd.alias=merchant
|
||||
lnd.externalip=loop.merchant.com
|
||||
lnd.rpclisten=0.0.0.0:10009
|
||||
lnd.listen=0.0.0.0:9735
|
||||
lnd.debuglevel=debug
|
||||
|
||||
# Lnd - bitcoin
|
||||
lnd.bitcoin.active=true
|
||||
lnd.bitcoin.testnet=true
|
||||
lnd.bitcoin.node=bitcoind
|
||||
|
||||
# Lnd - bitcoind
|
||||
lnd.bitcoind.rpchost=localhost
|
||||
lnd.bitcoind.rpcuser=testnetuser
|
||||
lnd.bitcoind.rpcpass=testnetpw
|
||||
lnd.bitcoind.zmqpubrawblock=localhost:28332
|
||||
lnd.bitcoind.zmqpubrawtx=localhost:28333
|
||||
|
||||
# Loop
|
||||
loop.loopoutmaxparts=5
|
||||
|
||||
# Faraday
|
||||
faraday.min_monitored=48h
|
||||
|
||||
# Faraday - bitcoin
|
||||
faraday.connect_bitcoin=true
|
||||
faraday.bitcoin.host=localhost
|
||||
faraday.bitcoin.user=testnetuser
|
||||
faraday.bitcoin.password=testnetpw
|
||||
```
|
||||
|
||||
The default location for the `lit.conf` file will depend on your operating
|
||||
system:
|
||||
|
||||
- **On MacOS**: `~/Library/Application Support/Lit/lit.conf`
|
||||
- **On Linux**: `~/.lit/lit.conf`
|
||||
- **On Windows**: `~/AppData/Roaming/Lit/lit.conf`
|
||||
|
||||
## Upgrade Existing Nodes
|
||||
|
||||
If you already have existing `lnd`, `loop`, or `faraday` nodes, you can easily
|
||||
upgrade them to the LiT single executable while keeping all of your past data.
|
||||
|
||||
For `lnd`:
|
||||
|
||||
- if you use an `lnd.conf` file for configurations, copy that file to your
|
||||
LiT directory (`~/.lit` for example, see last section for other operating
|
||||
system's default directories) and call it `lit.conf`. Then edit `lit.conf`
|
||||
and add the `lnd.` prefix to each of the configuration parameters. You also
|
||||
have to remove any section headers (the lines starting with `[` and ending
|
||||
with `]`, for example `[Application Options]`) as these don't work with
|
||||
the additional levels of sub configurations. You can replace them with a
|
||||
comment (starting with the `#` character) to get the same grouping effect as
|
||||
before.
|
||||
|
||||
Before:
|
||||
|
||||
```text
|
||||
[Application Options]
|
||||
alias=merchant
|
||||
|
||||
[bitcoin]
|
||||
bitcoin.active=true
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```text
|
||||
# Application Options
|
||||
lnd.alias=merchant
|
||||
|
||||
# bitcoin
|
||||
lnd.bitcoin.active=true
|
||||
```
|
||||
|
||||
- if you use command line arguments for configuration, add the `lnd.` prefix to
|
||||
each argument to `litd`
|
||||
|
||||
Before:
|
||||
|
||||
```shell script
|
||||
$ lnd --lnddir=~/.lnd --alias=merchant ...
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```shell script
|
||||
$ litd lnd.lnddir=~/.lnd --lnd.alias=merchant ...
|
||||
```
|
||||
|
||||
For `loop`:
|
||||
|
||||
- if you use an `loop.conf` file for configurations, copy the parameters into
|
||||
the `lit.conf` and add the `loop.` prefix to each of the configuration
|
||||
parameters. Also remove any section headers or replace them with comments.
|
||||
|
||||
Before: (in `loop.conf`)
|
||||
|
||||
```text
|
||||
[Application Options]
|
||||
loopoutmaxparts=5
|
||||
```
|
||||
|
||||
After: (in `lit.conf`)
|
||||
|
||||
```text
|
||||
# Loop
|
||||
loop.loopoutmaxparts=5
|
||||
```
|
||||
|
||||
- if you use command line arguments for configuration, add the `loop.` prefix to
|
||||
each argument to `litd`
|
||||
|
||||
Before:
|
||||
|
||||
```shell script
|
||||
$ loop --loopoutmaxparts=5 --debuglevel=debug ...
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```shell script
|
||||
$ litd --loop.loopoutmaxparts=5 --loop.debuglevel=debug ...
|
||||
```
|
||||
|
||||
For `faraday`:
|
||||
|
||||
- the standalone `faraday` daemon does not load configuration from a file, but
|
||||
you can now store the parameters into the `lit.conf` file. Just add the
|
||||
`faraday.` prefix to each of the configuration parameters.
|
||||
|
||||
Before: (from command line)
|
||||
|
||||
```shell script
|
||||
$ faraday --min_monitored=48h
|
||||
```
|
||||
|
||||
After: (in `lit.conf`)
|
||||
|
||||
```text
|
||||
# Faraday
|
||||
faraday.min_monitored=48h
|
||||
```
|
||||
|
||||
- if you use command line arguments for configuration, add the `faraday.` prefix
|
||||
to each argument to `litd`
|
||||
|
||||
Before:
|
||||
|
||||
```shell script
|
||||
$ faraday --min_monitored=48h --debuglevel=debug ...
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```shell script
|
||||
$ litd --faraday.min_monitored=48h --faraday.debuglevel=debug...
|
||||
```
|
||||
|
||||
## Upgrading from LiT v0.1.1-alpha or earlier
|
||||
|
||||
If you used command line arguments only, you don't need to change anything when
|
||||
updating from LiT `v0.1.1-alpha` or earlier.
|
||||
|
||||
If you used an `lnd.conf` file for LiT configurations, move that file to your
|
||||
LiT directory (`~/.lit` for example, see last section for other operating
|
||||
system's default directories) and call it `lit.conf`. Then edit `lit.conf`
|
||||
and remove any section headers (the lines starting with `[` and ending
|
||||
with `]`, for example `[Application Options]`) as these don't work with
|
||||
the additional levels of sub configurations. You can replace them with a
|
||||
comment (starting with the `#` character) to get the same grouping effect as
|
||||
before.
|
||||
|
||||
## Example commands for interacting with the command line
|
||||
|
||||
Because not all functionality of `lnd` (or `loop`/`faraday` for that matter) is
|
||||
available through the web UI, it will still be necessary to interact with those
|
||||
daemons through the command line.
|
||||
|
||||
We are going through an example for each of the command line tools and will
|
||||
explain the reasons for the extra flags.
|
||||
The examples assume that LiT is started with the following configuration (only
|
||||
relevant parts shown here):
|
||||
|
||||
```text
|
||||
lnd-mode=integrated
|
||||
|
||||
lnd.lnddir=~/.lnd
|
||||
lnd.rpclisten=0.0.0.0:10009
|
||||
|
||||
lnd.bitcoin.testnet=true
|
||||
```
|
||||
|
||||
Because all components listen on the same gRPC port and use the same TLS
|
||||
certificate, some command line calls now need some extra options that weren't
|
||||
necessary before.
|
||||
|
||||
**NOTE**: All mentioned command line tools have the following behavior in
|
||||
common: You either specify the `--network` flag and the `--tlscertpath` and
|
||||
`--macaroonpath` are implied by looking inside the default directories for that
|
||||
network. Or you specify the `--tlscertpath` and `--macaroonpath` flags
|
||||
explicitly, then you **must not** set the `--network` flag. Otherwise, you will
|
||||
get an error like `[lncli] could not load global options: unable to read macaroon
|
||||
path (check the network setting!): open /home/<user>/.lnd/data/chain/bitcoin/testnet/admin.macaroon:
|
||||
no such file or directory`.
|
||||
|
||||
### Example `lncli` command
|
||||
|
||||
The `lncli` commands in the "integrated" mode are the same as if `lnd` was
|
||||
running standalone. The `--lnddir` flag does not need to be specified as long
|
||||
as it is the default directory (`~/.lnd` on Linux).
|
||||
|
||||
```shell script
|
||||
$ lncli --network=testnet getinfo
|
||||
```
|
||||
|
||||
### Example `loop` command
|
||||
|
||||
This is where things get a bit tricky. Because as mentioned above, `loopd` also
|
||||
runs on the same gRPC server as `lnd`. That's why we have to both specify the
|
||||
`host:port` as well as the TLS certificate of `lnd`. But `loopd` verifies its
|
||||
own macaroon, so we have to specify that one from the `.loop` directory.
|
||||
|
||||
```shell script
|
||||
$ loop --rpcserver=localhost:10009 --tlscertpath=~/.lnd/tls.cert \
|
||||
--macaroonpath=~/.loop/testnet/loop.macaroon \
|
||||
quote out 500000
|
||||
```
|
||||
|
||||
You can easily create an alias for this by adding the following line to your
|
||||
`~/.bashrc` file:
|
||||
|
||||
```shell script
|
||||
alias lit-loop="loop --rpcserver=localhost:10009 --tlscertpath=~/.lnd/tls.cert --macaroonpath=~/.loop/testnet/loop.macaroon"
|
||||
```
|
||||
|
||||
### Example `frcli` command
|
||||
|
||||
Faraday's command line tool follows the same pattern as loop. We also have to
|
||||
specify the server and TLS flags for `lnd` but use `faraday`'s macaroon:
|
||||
|
||||
```shell script
|
||||
$ frcli --rpcserver=localhost:10009 --tlscertpath=~/.lnd/tls.cert \
|
||||
--macaroonpath=~/.faraday/testnet/faraday.macaroon \
|
||||
audit
|
||||
```
|
||||
|
||||
You can easily create an alias for this by adding the following line to your
|
||||
`~/.bashrc` file:
|
||||
|
||||
```shell script
|
||||
alias lit-frcli="frcli --rpcserver=localhost:10009 --tlscertpath=~/.lnd/tls.cert --macaroonpath=~/.faraday/testnet/faraday.macaroon"
|
||||
```
|
||||
212
doc/config-lnd-remote.md
Normal file
212
doc/config-lnd-remote.md
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
# Configuring LiT with remote lnd node
|
||||
|
||||
The "remote" mode means that `lnd` is started as a standalone process, possibly
|
||||
on another host, and `litd` connects to it, right after starting its UI server.
|
||||
Once the connection to the remote `lnd` node has been established, `litd` then
|
||||
goes ahead and starts `faraday` and `loop` and connects them to that `lnd` node
|
||||
as well.
|
||||
|
||||
Currently the UI server cannot connect to `loop` or `faraday` daemons that
|
||||
aren't running in the same process. But that feature will also be available in
|
||||
future versions.
|
||||
|
||||
## Use command line parameters only
|
||||
|
||||
In addition to the LiT specific and remote `lnd` parameters, you must also
|
||||
provide configuration to the `loop` and `faraday` daemons. For the remote `lnd`
|
||||
node, all `remote.lnd` flags must be specified. Note that `loopd` and
|
||||
`faraday` will automatically connect to the same remote `lnd` node, so you do
|
||||
not need to provide them with any additional parameters unless you want to
|
||||
override them. If you do override them, be sure to add the `loop.` and `faraday.`
|
||||
prefixes.
|
||||
|
||||
To see all available command line options, run `litd --help`.
|
||||
|
||||
The most minimal example command to start `litd` and connect it to a local `lnd`
|
||||
node that is running with default configuration settings is:
|
||||
|
||||
```shell script
|
||||
$ litd --uipassword=My$trongP@ssword
|
||||
```
|
||||
|
||||
All other command line flags are only needed to overwrite the default behavior.
|
||||
|
||||
Here is an example command to start `litd` connected to a testnet `lnd` that is
|
||||
running on another host and overwrites a few default settings in `loop` and
|
||||
`faraday` (optional):
|
||||
|
||||
```shell script
|
||||
$ litd \
|
||||
--httpslisten=0.0.0.0:443 \
|
||||
--uipassword=My$trongP@ssword \
|
||||
--letsencrypt \
|
||||
--letsencrypthost=loop.merchant.com \
|
||||
--lit-dir=~/.lit \
|
||||
--remote.lit-debuglevel=debug \
|
||||
--remote.lnd.network=testnet \
|
||||
--remote.lnd.rpcserver=some-other-host:10009 \
|
||||
--remote.lnd.macaroondir=/some/folder/with/lnd/data \
|
||||
--remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert \
|
||||
--loop.loopoutmaxparts=5 \
|
||||
--faraday.min_monitored=48h \
|
||||
--faraday.connect_bitcoin \
|
||||
--faraday.bitcoin.host=some-other-host \
|
||||
--faraday.bitcoin.user=testnetuser \
|
||||
--faraday.bitcoin.password=testnetpw
|
||||
```
|
||||
|
||||
NOTE: Even though LiT itself only needs `lnd`'s `admin.macaroon`, the `loop` and
|
||||
`faraday` daemons will require other macaroons and will look for them in the
|
||||
folder specified with `--remote.lnd.macaroondir`. It is advised to copy all
|
||||
`*.macaroon` files and the `tls.cert` file from the remote host to the host that
|
||||
is running `litd`.
|
||||
|
||||
## Use a configuration file
|
||||
|
||||
You can also store the configuration in a persistent `~/.lit/lit.conf` file, so
|
||||
you do not need to type in the command line arguments every time you start the
|
||||
server. Just remember to use the appropriate prefixes as necessary.
|
||||
|
||||
Make sure you don't add any section headers (the lines starting with `[` and
|
||||
ending with `]`, for example `[Application Options]`) as these don't work with
|
||||
the additional levels of sub configurations. You can replace them with a
|
||||
comment (starting with the `#` character) to get the same grouping effect as
|
||||
before.
|
||||
|
||||
The most minimal example of a `~/.lit/lit.conf` file that connects to a local
|
||||
`lnd` node that is running with default configuration settings is:
|
||||
|
||||
```text
|
||||
# Application Options
|
||||
uipassword=My$trongP@ssword
|
||||
```
|
||||
|
||||
All other configuration settings are only needed to overwrite the default
|
||||
behavior.
|
||||
|
||||
Here is an example `~/.lit/lit.conf` file that connects LiT to a testnet `lnd`
|
||||
node running on another host and overwrites a few default settings in `loop` and
|
||||
`faraday` (optional):
|
||||
|
||||
```text
|
||||
# Application Options
|
||||
httpslisten=0.0.0.0:443
|
||||
uipassword=My$trongP@ssword
|
||||
letsencrypt=true
|
||||
letsencrypthost=loop.merchant.com
|
||||
lit-dir=~/.lit
|
||||
|
||||
# Remote options
|
||||
remote.lit-debuglevel=debug
|
||||
|
||||
# Remote lnd options
|
||||
remote.lnd.network=testnet
|
||||
remote.lnd.rpcserver=some-other-host:10009
|
||||
remote.lnd.macaroondir=/some/folder/with/lnd/data
|
||||
remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert
|
||||
|
||||
# Loop
|
||||
loop.loopoutmaxparts=5
|
||||
|
||||
# Faraday
|
||||
faraday.min_monitored=48h
|
||||
|
||||
# Faraday - bitcoin
|
||||
faraday.connect_bitcoin=true
|
||||
faraday.bitcoin.host=localhost
|
||||
faraday.bitcoin.user=testnetuser
|
||||
faraday.bitcoin.password=testnetpw
|
||||
```
|
||||
|
||||
The default location for the `lit.conf` file will depend on your operating
|
||||
system:
|
||||
|
||||
- **On MacOS**: `~/Library/Application Support/Lit/lit.conf`
|
||||
- **On Linux**: `~/.lit/lit.conf`
|
||||
- **On Windows**: `~/AppData/Roaming/Lit/lit.conf`
|
||||
|
||||
|
||||
## Example commands for interacting with the command line
|
||||
|
||||
Because not all functionality of `lnd` (or `loop`/`faraday` for that matter) is
|
||||
available through the web UI, it will still be necessary to interact with those
|
||||
daemons through the command line.
|
||||
|
||||
We are going through an example for each of the command line tools and will
|
||||
explain the reasons for the extra flags.
|
||||
The examples assume that LiT is started with the following configuration (only
|
||||
relevant parts shown here):
|
||||
|
||||
```text
|
||||
httpslisten=0.0.0.0:443
|
||||
lit-dir=~/.lit
|
||||
|
||||
remote.lnd.network=testnet
|
||||
remote.lnd.rpcserver=some-other-host:10009
|
||||
remote.lnd.macaroondir=/some/folder/with/lnd/data
|
||||
remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert
|
||||
```
|
||||
|
||||
Because in the remote `lnd` mode all other LiT components (`loop`, `faraday` and
|
||||
the UI server) listen on the same port (`443` in this example) and use the same
|
||||
TLS certificate (`~/.lit/tls.cert` in this example), some command line calls now
|
||||
need some extra options that weren't necessary before.
|
||||
|
||||
**NOTE**: All mentioned command line tools have the following behavior in
|
||||
common: You either specify the `--network` flag and the `--tlscertpath` and
|
||||
`--macaroonpath` are implied by looking inside the default directories for that
|
||||
network. Or you specify the `--tlscertpath` and `--macaroonpath` flags
|
||||
explicitly, then you **must not** set the `--network` flag. Otherwise, you will
|
||||
get an error like `[lncli] could not load global options: unable to read macaroon
|
||||
path (check the network setting!): open /home/<user>/.lnd/data/chain/bitcoin/testnet/admin.macaroon:
|
||||
no such file or directory`.
|
||||
|
||||
### Example `lncli` command
|
||||
|
||||
The `lncli` commands in the "remote" mode are the same as if `lnd` was
|
||||
running standalone on a remote host. We need to specify all flags explicitly.
|
||||
|
||||
```shell script
|
||||
$ lncli --rpcserver=some-other-host:10009 \
|
||||
--tlscertpath=/some/folder/with/lnd/data/tls.cert \
|
||||
--macaroonpath=/some/folder/with/lnd/data/admin.macaroon \
|
||||
getinfo
|
||||
```
|
||||
|
||||
### Example `loop` command
|
||||
|
||||
This is where things get a bit tricky. Because as mentioned above, `loopd` also
|
||||
runs on the same port as the UI server. That's why we have to both specify the
|
||||
`host:port` as well as the TLS certificate of LiT. But `loopd` verifies its
|
||||
own macaroon, so we have to specify that one from the `.loop` directory.
|
||||
|
||||
```shell script
|
||||
$ loop --rpcserver=localhost:443 --tlscertpath=~/.lit/tls.cert \
|
||||
--macaroonpath=~/.loop/testnet/loop.macaroon \
|
||||
quote out 500000
|
||||
```
|
||||
|
||||
You can easily create an alias for this by adding the following line to your
|
||||
`~/.bashrc` file:
|
||||
|
||||
```shell script
|
||||
alias lit-loop="loop --rpcserver=localhost:443 --tlscertpath=~/.lit/tls.cert --macaroonpath=~/.loop/testnet/loop.macaroon"
|
||||
```
|
||||
|
||||
### Example `frcli` command
|
||||
|
||||
Faraday's command line tool follows the same pattern as loop. We also have to
|
||||
specify the server and TLS flags for `lnd` but use `faraday`'s macaroon:
|
||||
|
||||
```shell script
|
||||
$ frcli --rpcserver=localhost:443 --tlscertpath=~/.lit/tls.cert \
|
||||
--macaroonpath=~/.faraday/testnet/faraday.macaroon \
|
||||
audit
|
||||
```
|
||||
|
||||
You can easily create an alias for this by adding the following line to your
|
||||
`~/.bashrc` file:
|
||||
|
||||
```shell script
|
||||
alias lit-frcli="frcli --rpcserver=localhost:443 --tlscertpath=~/.lit/tls.cert --macaroonpath=~/.faraday/testnet/faraday.macaroon"
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue