pool/docs/install.md

100 lines
4.6 KiB
Markdown
Raw Permalink Normal View History

2020-10-14 10:52:41 +00:00
# Installation
2020-11-02 14:28:12 +00:00
## Installation
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
Lightning Pool is built very similarly to [Lightning Loop](https://github.com/lightninglabs/loop): There is a process that is constantly running in the background, called the trader daemon \(`poold`\) and a command line tool to interact with the daemon, called just `pool`.
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
The `poold` trader daemon can be run either as a standalone binary connected to a compatible `lnd` node or integrated into [Lightning Terminal \(LiT\)](https://github.com/lightninglabs/lightning-terminal).
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
### Downloading the standalone binaries
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
The latest official release binaries can be [downloaded from the GitHub releases page](https://github.com/lightninglabs/pool/releases).
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
### Downloading as part of Lightning Terminal \(LiT\)
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
To run `poold` integrated into the Lightning Terminal, download [the latest release of LiT](https://github.com/lightninglabs/lightning-terminal/releases) and follow [the installation instructions of LiT](https://github.com/lightninglabs/lightning-terminal#execution)
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
### Building the binaries from source
2020-10-14 14:26:00 +02:00
2025-03-05 12:41:32 +02:00
To build both the `poold` and `pool` binaries from the source code, at least
the `go 1.18` and `make` must be installed.
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
To download the code, compile and install it, the following commands can then be run:
```text
$ git clone https://github.com/lightninglabs/pool
$ cd pool
$ make install
```
2020-10-30 01:23:15 +00:00
2020-10-14 14:26:00 +02:00
This will install the binaries into your `$GOPATH/bin` directory.
2020-11-02 14:28:12 +00:00
### Installing `lnd`
2020-10-14 14:26:00 +02:00
2021-12-07 20:08:56 +01:00
Lightning Pool needs to be connected to an `lnd` node version `v0.12.0-beta` (`v0.13.3-beta` recommended!) or later to work. It is recommended to run an [official release binary of `lnd`](https://github.com/lightningnetwork/lnd/releases).
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
[Installing `lnd` from source](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md#installing-lnd) is also possible but needs to be done **with all sub-server build flags enabled**:
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
```text
2020-10-14 14:26:00 +02:00
$ make install tags="signrpc walletrpc chainrpc invoicesrpc"
```
2020-11-02 14:28:12 +00:00
### Running `poold`
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
If `lnd` is configured with the default values and is running on the same machine, `poold` will be able to connect to it automatically and can be started by simply running:
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
```text
$ poold
2020-10-14 14:26:00 +02:00
# Or if you want to do everything in the same terminal and run poold in the
# background:
2020-10-14 14:26:00 +02:00
$ poold &
# For testnet mode, you'll need to specify the network as mainnet is the
# default:
2020-10-14 14:26:00 +02:00
$ poold --network=testnet
```
2020-10-14 14:26:00 +02:00
In the case that `lnd` is running on a remote node, the `tls.cert` and the `admin.macaroon` files from the `lnd` data directory need to be copied to the machine where `poold` is running.
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
The daemon can then be configured to connect to the remote `lnd` node by using the following command line flags:
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
```text
2020-10-14 14:26:00 +02:00
$ poold --lnd.host=<the_remote_host_IP_address>:10009 \
--lnd.macaroonpath=/some/directory/with/lnd/data/macaroons/admin.macaroon \
2020-10-14 14:26:00 +02:00
--lnd.tlspath=/some/directory/with/lnd/data/tls.cert
```
To persist this configuration, these values can also be written to a configuration file, located in `~/.pool/<network>/poold.conf`, for example:
2020-10-14 14:26:00 +02:00
> ~/.pool/mainnet/poold.conf
2020-11-02 14:28:12 +00:00
>
> ```text
> lnd.host=<the_remote_host_IP_address>:10009
> lnd.macaroonpath=/some/directory/with/lnd/data/macaroons/admin.macaroon
2020-11-02 14:28:12 +00:00
> lnd.tlspath=/some/directory/with/lnd/data/tls.cert
> ```
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
### Configuration options
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
There is a range of operational settings that can be set to change the default logging behavior or change the directories where `poold` stores its data. To see the full list of options, run `poold --help`.
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
The following list only includes flags that have an impact on the match making or business related behavior of the Pool trader daemon:
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
| Flag | Required | Default Value | Description |
| :--- | :--- | :--- | :--- |
2020-10-14 14:26:00 +02:00
| `newnodesonly` | No | `false` | If set to `true` the daemon will only buy channels from nodes it does not yet have channels with |
2020-11-02 14:28:12 +00:00
## Authentication and transport security
The gRPC and REST connections of `poold` are encrypted with TLS and secured with macaroon authentication the same way `lnd` is.
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
If no custom base directory is set then the TLS certificate is stored in `~/.pool/<network>/tls.cert` and the base macaroon in `~/.pool/<network>/pool.macaroon`.
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
The `pool` command will pick up these file automatically on mainnet if no custom base directory is used. For other networks it should be sufficient to add the `--network` flag to tell the CLI in what sub directory to look for the files.
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
For more information on macaroons, [see the macaroon documentation of lnd.](https://github.com/lightningnetwork/lnd/blob/master/docs/macaroons.md)
2020-10-14 14:26:00 +02:00
2020-11-02 14:28:12 +00:00
**NOTE**: pool's macaroons are independent from `lnd`'s. The same macaroon cannot be used for both `poold` and `lnd`.
2020-10-14 14:26:00 +02:00