Skip to content

Commit 5d5b3d6

Browse files
authored
Merge pull request #8 from guggero/pool-daemon-only
mod+terminal: add poold
2 parents 7487a2f + ef624d8 commit 5d5b3d6

15 files changed

+256
-57
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ RUN apk add --no-cache --update alpine-sdk \
3232
&& make install \
3333
&& go install -v -trimpath github.com/lightningnetwork/lnd/cmd/lncli \
3434
&& go install -v -trimpath github.com/lightninglabs/faraday/cmd/frcli \
35-
&& go install -v -trimpath github.com/lightninglabs/loop/cmd/loop
35+
&& go install -v -trimpath github.com/lightninglabs/loop/cmd/loop \
36+
&& go install -v -trimpath github.com/lightninglabs/pool/cmd/pool
3637

3738
# Start a new, final image to reduce size.
3839
FROM alpine as final
@@ -48,6 +49,7 @@ COPY --from=builder /go/bin/litd /bin/
4849
COPY --from=builder /go/bin/lncli /bin/
4950
COPY --from=builder /go/bin/frcli /bin/
5051
COPY --from=builder /go/bin/loop /bin/
52+
COPY --from=builder /go/bin/pool /bin/
5153

5254
# Add bash.
5355
RUN apk add --no-cache \

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Lightning Terminal (LiT) is a browser-based interface for managing channel liqui
1010
- Visualize your channels and balances
1111
- Perform submarine swaps via the [Lightning Loop](https://lightning.engineering/loop) service
1212
- Classify channels according to your node's operating mode
13-
- Run a single binary that integrates both [`loopd`](https://github.com/lightninglabs/loop) and [`faraday`](https://github.com/lightninglabs/faraday) daemons all in one
13+
- Run a single binary that integrates [`loopd`](https://github.com/lightninglabs/loop),
14+
[`poold`](https://github.com/lightninglabs/pool) and
15+
[`faraday`](https://github.com/lightninglabs/faraday) daemons all in one
1416

1517
## Installation
1618
Download the latest binaries from the [releases](https://github.com/lightninglabs/lightning-terminal/releases) page.
@@ -60,17 +62,18 @@ If you’d prefer to compile from source code please follow [these instructions]
6062

6163
## Compatibility
6264

63-
Lightning Terminal is backwards compatible with `lnd` back to version v0.11.0-beta
65+
Lightning Terminal is backwards compatible with `lnd` back to version v0.11.1-beta
6466

6567
| LiT | LND |
6668
| ---------------- | ------------ |
69+
| **v0.3.0-alpha** | v0.11.1-beta |
6770
| **v0.2.0-alpha** | v0.11.0-beta |
6871

6972
## Daemon Versions packaged with LiT
7073

71-
| LiT | LND | Loop | Faraday |
72-
| ---------------- | ------------ | ----------- | ------------ |
73-
| **v0.2.0-alpha** | v0.11.1-beta | v0.10.0-beta | v0.2.1-alpha |
74-
| **v0.1.1-alpha** | v0.11.0-beta | v0.8.1-beta | v0.2.0-alpha |
75-
| **v0.1.0-alpha** | v0.10.3-beta | v0.6.5-beta | v0.2.0-alpha |
76-
74+
| LiT | LND | Loop | Faraday | Pool |
75+
| ---------------- | ------------ | ----------- | ------------ |---------------|
76+
| **v0.3.0-alpha** | v0.11.1-beta | v0.11.0-beta | v0.2.2-alpha | v0.3.2-alpha |
77+
| **v0.2.0-alpha** | v0.11.1-beta | v0.10.0-beta | v0.2.1-alpha | n/a |
78+
| **v0.1.1-alpha** | v0.11.0-beta | v0.8.1-beta | v0.2.0-alpha | n/a |
79+
| **v0.1.0-alpha** | v0.10.3-beta | v0.6.5-beta | v0.2.0-alpha | n/a |

config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/lightninglabs/faraday/frdrpc"
1919
"github.com/lightninglabs/lndclient"
2020
"github.com/lightninglabs/loop/loopd"
21+
"github.com/lightninglabs/pool"
2122
"github.com/lightningnetwork/lnd"
2223
"github.com/lightningnetwork/lnd/build"
2324
"github.com/lightningnetwork/lnd/cert"
@@ -64,6 +65,7 @@ var (
6465
lndDefaultConfig = lnd.DefaultConfig()
6566
faradayDefaultConfig = faraday.DefaultConfig()
6667
loopDefaultConfig = loopd.DefaultConfig()
68+
poolDefaultConfig = pool.DefaultConfig()
6769

6870
// defaultLitDir is the default directory where LiT tries to find its
6971
// configuration file and store its data (in remote lnd node). This is a
@@ -128,6 +130,7 @@ type Config struct {
128130

129131
Faraday *faraday.Config `group:"Faraday options" namespace:"faraday"`
130132
Loop *loopd.Config `group:"Loop options" namespace:"loop"`
133+
Pool *pool.Config `group:"pool" namespace:"pool"`
131134

132135
Lnd *lnd.Config `group:"Integrated lnd (use when lnd-mode=integrated)" namespace:"lnd"`
133136

@@ -237,6 +240,7 @@ func defaultConfig() *Config {
237240
Faraday: &faradayDefaultConfig,
238241
faradayRpcConfig: &frdrpc.Config{},
239242
Loop: &loopDefaultConfig,
243+
Pool: &poolDefaultConfig,
240244
}
241245
}
242246

@@ -321,6 +325,11 @@ func loadAndValidateConfig() (*Config, error) {
321325
return nil, err
322326
}
323327

328+
cfg.Pool.Network = cfg.network
329+
if err := pool.Validate(cfg.Pool); err != nil {
330+
return nil, err
331+
}
332+
324333
cfg.Faraday.Network = cfg.network
325334
if err := faraday.ValidateConfig(cfg.Faraday); err != nil {
326335
return nil, err

doc/compile.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ $ make install
2020
```
2121

2222
This will produce the `litd` executable and add it to your `GOPATH`. The CLI binaries for
23-
`lncli`, `loop`, and `frcli` are not created by `make install`. You will need to download
24-
those binaries from the [lnd](https://github.com/lightningnetwork/lnd/releases),
25-
[loop](https://github.com/lightninglabs/loop/releases), and
23+
`lncli`, `loop`, `pool`, and `frcli` are not created by `make install`. You will
24+
need to download those binaries from the
25+
[lnd](https://github.com/lightningnetwork/lnd/releases),
26+
[loop](https://github.com/lightninglabs/loop/releases),
27+
[pool](https://github.com/lightninglabs/pool/releases), and
2628
[faraday](https://github.com/lightninglabs/faraday/releases) repos manually.

doc/config-lnd-integrated.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
The "integrated" mode means that `lnd` is started within the same process as
44
`litd`, alongside the UI server. Once the integrated `lnd` has been unlocked,
5-
`litd` then goes ahead and starts `faraday` and `loop` and connects them to the
6-
integrated `lnd` node.
5+
`litd` then goes ahead and starts `faraday`, `pool` and `loop` and connects them
6+
to the integrated `lnd` node.
77

8-
Currently the UI server cannot connect to `loop` or `faraday` daemons that
9-
aren't running in the same process. But that feature will also be available in
10-
future versions.
8+
Currently the UI server cannot connect to `loop`, `pool` or `faraday` daemons
9+
that aren't running in the same process. But that feature will also be available
10+
in future versions.
1111

1212
## Use command line parameters only
1313

@@ -99,6 +99,9 @@ lnd.bitcoind.zmqpubrawtx=localhost:28333
9999
# Loop
100100
loop.loopoutmaxparts=5
101101
102+
# Pool
103+
pool.newnodesonly=true
104+
102105
# Faraday
103106
faraday.min_monitored=48h
104107
@@ -314,6 +317,25 @@ You can easily create an alias for this by adding the following line to your
314317
alias lit-loop="loop --rpcserver=localhost:10009 --tlscertpath=~/.lnd/tls.cert --macaroonpath=~/.loop/testnet/loop.macaroon"
315318
```
316319

320+
### Example `pool` command
321+
322+
Again, `poold` also runs on the same gRPC server as `lnd` and we have to specify
323+
the `host:port` and the TLS certificate of `lnd` but use the macaroon from the
324+
`.pool` directory.
325+
326+
```shell script
327+
$ pool --rpcserver=localhost:10009 --tlscertpath=~/.lnd/tls.cert \
328+
--macaroonpath=~/.pool/testnet/pool.macaroon \
329+
accounts list
330+
```
331+
332+
You can easily create an alias for this by adding the following line to your
333+
`~/.bashrc` file:
334+
335+
```shell script
336+
alias lit-pool="pool --rpcserver=localhost:10009 --tlscertpath=~/.lnd/tls.cert --macaroonpath=~/.pool/testnet/pool.macaroon"
337+
```
338+
317339
### Example `frcli` command
318340

319341
Faraday's command line tool follows the same pattern as loop. We also have to

doc/config-lnd-remote.md

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,34 +54,36 @@ Visit https://localhost:8443 to access LiT.
5454

5555
The "remote" mode means that `lnd` is started as a standalone process, possibly on another
5656
host, and `litd` connects to it, right after starting its UI server. Once the connection
57-
to the remote `lnd` node has been established, `litd` then goes ahead and starts `faraday`
58-
and `loop` and connects them to that `lnd` node as well.
57+
to the remote `lnd` node has been established, `litd` then goes ahead and starts
58+
`faraday`, `pool` and `loop` and connects them to that `lnd` node as well.
5959

60-
Currently the UI server cannot connect to `loop` or `faraday` daemons that aren't running
61-
in the same process. But that feature will also be available in future versions.
60+
Currently the UI server cannot connect to `loop`, `pool` or `faraday` daemons
61+
that aren't running in the same process. But that feature will also be available
62+
in future versions.
6263

6364
## Use command line parameters only
6465

6566
In addition to the LiT specific and remote `lnd` parameters, you must also provide
66-
configuration to the `loop` and `faraday` daemons. For the remote `lnd` node, all
67+
configuration to the `loop`, `pool`, and `faraday` daemons. For the remote `lnd` node, all
6768
`remote.lnd` flags must be specified. Note that `loopd` and `faraday` will automatically
6869
connect to the same remote `lnd` node, so you do not need to provide them with any
6970
additional parameters unless you want to override them. If you do override them, be sure
70-
to add the `loop.` and `faraday.` prefixes.
71+
to add the `loop.`, `pool.`, and `faraday.` prefixes.
7172

7273
To see all available command line options, run `litd --help`.
7374

74-
The most minimal example command to start `litd` and connect it to a local `lnd` node that
75-
is running with default configuration settings is:
75+
The most minimal example command to start `litd` and connect it to a local `lnd`
76+
node that is running with default configuration settings is:
7677

7778
```shell script
7879
$ litd --uipassword=My$trongP@ssword
7980
```
8081

8182
All other command line flags are only needed to overwrite the default behavior.
8283

83-
Here is an example command to start `litd` connected to a testnet `lnd` that is running on
84-
another host and overwrites a few default settings in `loop` and `faraday` (optional):
84+
Here is an example command to start `litd` connected to a testnet `lnd` that is
85+
running on another host and overwrites a few default settings in `loop`, `pool`,
86+
and `faraday` (optional):
8587

8688
```shell script
8789
$ litd \
@@ -96,17 +98,19 @@ $ litd \
9698
--remote.lnd.macaroondir=/some/folder/with/lnd/data \
9799
--remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert \
98100
--loop.loopoutmaxparts=5 \
101+
--pool.newnodesonly=true \
99102
--faraday.min_monitored=48h \
100103
--faraday.connect_bitcoin \
101104
--faraday.bitcoin.host=some-other-host \
102105
--faraday.bitcoin.user=testnetuser \
103106
--faraday.bitcoin.password=testnetpw
104107
```
105108

106-
NOTE: Even though LiT itself only needs `lnd`'s `admin.macaroon`, the `loop` and `faraday`
107-
daemons will require other macaroons and will look for them in the folder specified with
108-
`--remote.lnd.macaroondir`. It is advised to copy all `*.macaroon` files and the
109-
`tls.cert` file from the remote host to the host that is running `litd`.
109+
NOTE: Even though LiT itself only needs `lnd`'s `admin.macaroon`, the `loop`,
110+
`pool`, and `faraday` daemons will require other macaroons and will look for
111+
them in the folder specified with `--remote.lnd.macaroondir`. It is advised to
112+
copy all `*.macaroon` files and the `tls.cert` file from the remote host to the
113+
host that is running `litd`.
110114

111115
## Use a configuration file
112116

@@ -130,8 +134,8 @@ uipassword=My$trongP@ssword
130134
All other configuration settings are only needed to overwrite the default behavior.
131135

132136
Here is an example `~/.lit/lit.conf` file that connects LiT to a testnet `lnd` node
133-
running on another host and overwrites a few default settings in `loop` and `faraday`
134-
(optional):
137+
running on another host and overwrites a few default settings in `loop`, `pool`,
138+
and `faraday` (optional):
135139

136140
```text
137141
# Application Options
@@ -153,6 +157,9 @@ remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert
153157
# Loop
154158
loop.loopoutmaxparts=5
155159
160+
# Pool
161+
pool.newnodesonly=true
162+
156163
# Faraday
157164
faraday.min_monitored=48h
158165
@@ -189,10 +196,10 @@ remote.lnd.macaroondir=/some/folder/with/lnd/data
189196
remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert
190197
```
191198

192-
Because in the remote `lnd` mode all other LiT components (`loop`, `faraday` and the UI
193-
server) listen on the same port (`443` in this example) and use the same TLS certificate
194-
(`~/.lit/tls.cert` in this example), some command line calls now need some extra options
195-
that weren't necessary before.
199+
Because in the remote `lnd` mode all other LiT components (`loop`, `pool`,
200+
`faraday` and the UI server) listen on the same port (`443` in this example) and
201+
use the same TLS certificate (`~/.lit/tls.cert` in this example), some command
202+
line calls now need some extra options that weren't necessary before.
196203

197204
**NOTE**: All mentioned command line tools have the following behavior in common: You
198205
either specify the `--network` flag and the `--tlscertpath` and `--macaroonpath` are
@@ -233,6 +240,25 @@ file:
233240
alias lit-loop="loop --rpcserver=localhost:443 --tlscertpath=~/.lit/tls.cert --macaroonpath=~/.loop/testnet/loop.macaroon"
234241
```
235242

243+
### Example `pool` command
244+
245+
Again, `poold` also runs on the same port as the UI server and we have to
246+
specify the `host:port` and the TLS certificate of LiT but use the macaroon from
247+
the `.pool` directory.
248+
249+
```shell script
250+
$ pool --rpcserver=localhost:443 --tlscertpath=~/.lit/tls.cert \
251+
--macaroonpath=~/.pool/testnet/pool.macaroon \
252+
accounts list
253+
```
254+
255+
You can easily create an alias for this by adding the following line to your
256+
`~/.bashrc` file:
257+
258+
```shell script
259+
alias lit-pool="pool --rpcserver=localhost:443 --tlscertpath=~/.lit/tls.cert --macaroonpath=~/.pool/testnet/pool.macaroon"
260+
```
261+
236262
### Example `frcli` command
237263

238264
Faraday's command line tool follows the same pattern as loop. We also have to specify the

doc/letsencrypt.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,27 @@ file:
112112
alias lit-loop="loop --rpcserver=terminal.mydomain.com:8443 --tlscertpath=~/.lit/letsencrypt/terminal.mydomain.com --macaroonpath=~/.loop/testnet/loop.macaroon"
113113
```
114114

115+
### Example `pool` command
116+
117+
Since `poold` also runs on the same gRPC server as `lnd`, we have to specify the
118+
**LetEncrypt** `host:port` and TLS certificate. But `poold` verifies its own
119+
macaroon, so we have to specify that one from the `.pool` directory.
120+
121+
```shell script
122+
$ pool \
123+
--rpcserver=terminal.mydomain.com:8443 \
124+
--tlscertpath=~/.lit/letsencrypt/terminal.mydomain.com \
125+
--macaroonpath=~/.pool/testnet/pool.macaroon \
126+
accounts list
127+
```
128+
129+
You can easily create an alias for this by adding the following line to your
130+
`~/.bashrc` file:
131+
132+
```shell script
133+
alias lit-pool="pool --rpcserver=terminal.mydomain.com:8443 --tlscertpath=~/.lit/letsencrypt/terminal.mydomain.com --macaroonpath=~/.loop/testnet/loop.macaroon"
134+
```
135+
115136
### Example `frcli` command
116137

117138
Faraday's command line tool follows the same pattern as loop. We also have to specify the

doc/troubleshooting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ If you have trouble running your node, please first check the logs for warnings
44
If there are errors relating to one of the embedded servers, then you should open an issue
55
in their respective GitHub repos ([lnd](https://github.com/lightningnetwork/lnd/issues),
66
[loop](https://github.com/lightninglabs/loop/issues),
7+
[pool](https://github.com/lightninglabs/pool/issues),
78
[faraday](https://github.com/lightninglabs/faraday/issues). If the issue is related to the
89
web app, then you should open an
910
[issue](https://github.com/lightninglabs/lightning-terminal/issues) here in this repo.

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ require (
44
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
55
github.com/btcsuite/btcutil v1.0.2
66
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
7-
github.com/grpc-ecosystem/grpc-gateway v1.14.3
7+
github.com/grpc-ecosystem/grpc-gateway v1.14.6
88
github.com/improbable-eng/grpc-web v0.12.0
99
github.com/jessevdk/go-flags v1.4.0
10-
github.com/lightninglabs/faraday v0.2.1-alpha.0.20201012084956-438cb323aa24
11-
github.com/lightninglabs/lndclient v0.11.0-0
12-
github.com/lightninglabs/loop v0.10.0-beta
13-
github.com/lightningnetwork/lnd v0.11.1-beta.rc3
10+
github.com/lightninglabs/aperture v0.1.3-beta
11+
github.com/lightninglabs/faraday v0.2.2-alpha
12+
github.com/lightninglabs/lndclient v0.11.0-3
13+
github.com/lightninglabs/loop v0.11.0-beta.0.20201030095204-66eff361c2ef
14+
github.com/lightninglabs/pool v0.3.2-alpha
15+
github.com/lightningnetwork/lnd v0.11.1-beta
1416
github.com/lightningnetwork/lnd/cert v1.0.3
1517
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
1618
github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76
@@ -20,11 +22,9 @@ require (
2022
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
2123
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
2224
golang.org/x/sys v0.0.0-20200406155108-e3b113bbe6a4 // indirect
23-
google.golang.org/grpc v1.28.0
25+
google.golang.org/grpc v1.29.1
2426
gopkg.in/macaroon-bakery.v2 v2.1.0
2527
gopkg.in/macaroon.v2 v2.1.0
2628
)
2729

28-
replace github.com/lightningnetwork/lnd => github.com/lightningnetwork/lnd v0.11.1-beta
29-
3030
go 1.13

0 commit comments

Comments
 (0)