Skip to content

Commit 64ade93

Browse files
authored
Merge pull request #179 from lightninglabs/full-remote-mode
Add remote mode for faraday, loopd and poold
2 parents ad5e49b + c554c9e commit 64ade93

File tree

8 files changed

+422
-202
lines changed

8 files changed

+422
-202
lines changed

cmd/litd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func main() {
1414
err := terminal.New().Run()
1515
var flagErr *flags.Error
1616
isFlagErr := errors.As(err, &flagErr)
17-
if err != nil && (!isFlagErr || flagErr.Type != flags.ErrHelp) {
17+
if err != nil && (!isFlagErr || flagErr.Type != flags.ErrHelp) {
1818
_, _ = fmt.Fprintln(os.Stderr, err)
1919
os.Exit(1)
2020
}

config.go

Lines changed: 165 additions & 106 deletions
Large diffs are not rendered by default.

doc/config-lnd-integrated.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,13 @@ node:
3232
--uipassword=My$trongP@ssword \
3333
--letsencrypt \
3434
--letsencrypthost=loop.merchant.com \
35+
--network=testnet \
3536
--lnd-mode=integrated \
3637
--lnd.lnddir=/root/.lnd \
3738
--lnd.alias=merchant \
3839
--lnd.externalip=loop.merchant.com \
3940
--lnd.rpclisten=0.0.0.0:10009 \
4041
--lnd.listen=0.0.0.0:9735 \
41-
--lnd.bitcoin.active \
42-
--lnd.bitcoin.testnet \
4342
--lnd.bitcoin.node=bitcoind \
4443
--lnd.bitcoind.rpchost=localhost \
4544
--lnd.bitcoind.rpcuser=testnetuser \
@@ -75,6 +74,7 @@ httpslisten=0.0.0.0:8443
7574
letsencrypt=true
7675
letsencrypthost=loop.merchant.com
7776
lnd-mode=integrated
77+
network=testnet
7878
7979
# Lnd
8080
lnd.lnddir=~/.lnd
@@ -85,8 +85,6 @@ lnd.listen=0.0.0.0:9735
8585
lnd.debuglevel=debug
8686
8787
# Lnd - bitcoin
88-
lnd.bitcoin.active=true
89-
lnd.bitcoin.testnet=true
9088
lnd.bitcoin.node=bitcoind
9189
9290
# Lnd - bitcoind
@@ -151,13 +149,12 @@ For `lnd`:
151149
```text
152150
# New flag to tell LiT to run its own lnd in integrated mode. We need to set
153151
# this because "remote" is the new default value if we don't specify anything.
152+
# We also don't need to explicitly activate the Bitcoin network anymore as
153+
# that is the default for LiT.
154154
lnd-mode=integrated
155155
156156
# Application Options
157157
lnd.alias=merchant
158-
159-
# bitcoin
160-
lnd.bitcoin.active=true
161158
```
162159

163160
- if you use command line arguments for configuration, add the `lnd.` prefix to
@@ -271,11 +268,10 @@ relevant parts shown here):
271268

272269
```text
273270
lnd-mode=integrated
271+
network=testnet
274272
275273
lnd.lnddir=~/.lnd
276274
lnd.rpclisten=0.0.0.0:10009
277-
278-
lnd.bitcoin.testnet=true
279275
```
280276

281277
Because all components listen on the same gRPC port and use the same TLS

doc/config-lnd-remote.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,46 @@ Visit https://localhost:8443 to access LiT.
4949

5050
## Additional Configuration
5151

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

57-
Currently the UI server cannot connect to `loop`, `pool` or `faraday` daemons
58-
that aren't running in the same process. But that feature will also be available
59-
in future versions.
57+
### Connecting LiT to a remote faraday node
58+
59+
To instruct LiT to not start its own integrated `faraday` daemon but instead
60+
connect to an existing node, use the following configuration options:
61+
62+
```text
63+
faraday-mode=remote
64+
remote.faraday.rpcserver=<externally-reachable-ip-address>:8465
65+
remote.faraday.macaroonpath=/some/folder/with/faraday/data/faraday.macaroon
66+
remote.faraday.tlscertpath=/some/folder/with/faraday/data/tls.cert
67+
```
68+
69+
### Connecting LiT to a remote loopd node
70+
71+
To instruct LiT to not start its own integrated `loopd` daemon but instead
72+
connect to an existing node, use the following configuration options:
73+
74+
```text
75+
loop-mode=remote
76+
remote.loop.rpcserver=<externally-reachable-ip-address>:11010
77+
remote.loop.macaroonpath=/some/folder/with/loop/data/loop.macaroon
78+
remote.loop.tlscertpath=/some/folder/with/loop/data/tls.cert
79+
```
80+
81+
### Connecting LiT to a remote poold node
82+
83+
To instruct LiT to not start its own integrated `poold` daemon but instead
84+
connect to an existing node, use the following configuration options:
85+
86+
```text
87+
pool-mode=remote
88+
remote.pool.rpcserver=<externally-reachable-ip-address>:12010
89+
remote.pool.macaroonpath=/some/folder/with/pool/data/pool.macaroon
90+
remote.pool.tlscertpath=/some/folder/with/pool/data/tls.cert
91+
```
6092

6193
## Use command line parameters only
6294

@@ -89,8 +121,8 @@ and `faraday` (optional):
89121
--letsencrypt \
90122
--letsencrypthost=loop.merchant.com \
91123
--lit-dir=~/.lit \
124+
--network=testnet \
92125
--remote.lit-debuglevel=debug \
93-
--remote.lnd.network=testnet \
94126
--remote.lnd.rpcserver=some-other-host:10009 \
95127
--remote.lnd.macaroonpath=/some/folder/with/lnd/data/admin.macaroon \
96128
--remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert \
@@ -135,12 +167,12 @@ uipassword=My$trongP@ssword
135167
letsencrypt=true
136168
letsencrypthost=loop.merchant.com
137169
lit-dir=~/.lit
170+
network=testnet
138171
139172
# Remote options
140173
remote.lit-debuglevel=debug
141174
142175
# Remote lnd options
143-
remote.lnd.network=testnet
144176
remote.lnd.rpcserver=some-other-host:10009
145177
remote.lnd.macaroonpath=/some/folder/with/lnd/data/admin.macaroon
146178
remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert
@@ -180,8 +212,8 @@ configuration (only relevant parts shown here):
180212
```text
181213
httpslisten=0.0.0.0:8443
182214
lit-dir=~/.lit
215+
network=testnet
183216
184-
remote.lnd.network=testnet
185217
remote.lnd.rpcserver=some-other-host:10009
186218
remote.lnd.macaroonpath=/some/folder/with/lnd/data/admin.macaroon
187219
remote.lnd.tlscertpath=/some/folder/with/lnd/data/tls.cert

doc/letsencrypt.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ httpslisten=0.0.0.0:8443
7979
letsencrypt=1
8080
letsencrypthost=terminal.mydomain.com
8181
lnd-mode=integrated
82-
83-
lnd.bitcoin.testnet=true
82+
network=testnet
8483
```
8584

8685
### Example `lncli` command

doc/remote.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ rpclisten=0.0.0.0:10009
88
Copy the following files that are located in your `~/.lnd/data/chain/bitcoin/mainnet` directory on your remote machine to `/some/folder/with/lnd/data/` on your local machine (where you’ll be running LiT):
99
- tls.cert
1010
- admin.macaroon
11-
- chainnotifier.macaroon
12-
- invoices.macaroon
13-
- readonly.macaroon
14-
- router.macaroon
15-
- signer.macaroon
16-
- walletkit.macaroon
1711

1812
Create a `lit.conf` file. The default location LiT will look for the configuration file depends on your operating system:
1913
- MacOS: `~/Library/Application Support/Lit/lit.conf`

0 commit comments

Comments
 (0)