lightning-terminal icon indicating copy to clipboard operation
lightning-terminal copied to clipboard

Cannot set lookdir to right patch

Open elbandi opened this issue 4 years ago • 4 comments
trafficstars

If the loop config is other path than the default, the --loopdir parameter is not working.

Expected behavior

If i set the loopdir paramter, all loop files loaded from /srv/loop/....

Actual behavior

output:

2021-11-04 14:39:23.709 [INF] LITD: Dialing lnd gRPC server at localhost:10009
2021-11-04 14:39:23.709 [DBG] GRPC: parsed scheme: ""
2021-11-04 14:39:23.709 [DBG] GRPC: scheme "" not registered, fallback to default scheme
2021-11-04 14:39:23.709 [DBG] GRPC: ccResolverWrapper: sending update to cc: {[{localhost:10009  <nil> 0 <nil>}] <nil> <nil>}
2021-11-04 14:39:23.709 [DBG] GRPC: ClientConn switching balancer to "pick_first"
2021-11-04 14:39:23.709 [DBG] GRPC: Channel switches to new LB policy "pick_first"
2021-11-04 14:39:23.709 [DBG] GRPC: Subchannel Connectivity change to CONNECTING
2021-11-04 14:39:23.709 [DBG] GRPC: Channel Connectivity change to SHUTDOWN
2021-11-04 14:39:23.710 [DBG] GRPC: Subchannel picks a new address "localhost:10009" to connect
2021-11-04 14:39:23.710 [DBG] GRPC: Subchannel Connectivity change to SHUTDOWN
error starting lnd gRPC proxy server: could not dial remote loop: could not read loop TLS cert /srv/.loop/mainnet/tls.cert: open /srv/.loop/mainnet/tls.cert: no such file or directory

tlscertpath is not changed to /srv/loop/mainnet/tls.cert

# /srv/lit/litd --lit-dir=/srv/lit --configfile=/srv/lit/lit.conf --loop.loopdir=/srv/loop --loop.tlscertpath=/srv/loop/mainnet/tls.cert
could not load config: loopdir overwrites tlscertpath, please only set one value

To reproduce

/srv/lit/litd --lit-dir=/srv/lit --configfile=/srv/lit/lit.conf --loop.loopdir=/srv/loop

System information

standalone, ubuntu bionic lts, binary from release page.

# /srv/lit/litd -V
litd version 0.13.3-beta commit=lightning-terminal-v0.5.2-alpha

elbandi avatar Nov 04 '21 13:11 elbandi

Are you trying to connect to an existing Loop service? From your error it looks that way (could not dial remote loop). If you're using --loop-mode=remote then you need to specify the TLS certificate path with --remote.loop.tlscertpath (all the --loop.* flags become meaningless in --loop-mode=remote.

guggero avatar Nov 09 '21 16:11 guggero

Yes, loopd service is running as different process, and lit connect to as remote. Oh, so --loop.loopdir= is prefixing only the loop.* flags. Than, it would be good, if there will be a "directory setter" for remote.loop.macaroonpath and remote.pool.tlscertpath:

--loop-mode=remote --remote.loop.dir=/srv/loop

means:

--loop-mode=remote --remote.loop.macaroonpath=/srv/loop/mainnet/loop.macaroon --remote.loop.tlscertpath=/srv/loop/mainnet/tls.cert

elbandi avatar Nov 09 '21 17:11 elbandi

I agree that would be nice to shortcut some of the flags. But it would also add more flags to the already huge number of flags and new dependencies between them (what if the general --remote.loop.dir was set as well as the --remote.loop.macaroonpath?). So I'm going to declare this a feature request and de-prioritize it somewhat (a lot of other stuff going on at the moment). But thank you for the report!

guggero avatar Nov 09 '21 18:11 guggero

all remote.foo has two paths flags: macaroonpath and tlscertpath. not too much, but later this may be changed. so remote.*.dir is for future :)

another idea: if the remote.* macaroonpath and tlscertpath doesnt start with '/', means, it a relative location to .dir flags. eg:

--remote.loop.dir=/its/a/very/looooooonnnnnnggg/direcory/name/with/high/depth/path --remote.loop.macaroonpath=mainnet/loop-custom.macaroon --remote.loop.tlscertpath=mainnet/mytls.cert

this looks better than:

--remote.loop.macaroonpath=/its/a/very/looooooonnnnnnggg/direcory/name/with/high/depth/path/mainnet/loop-custom.macaroon --remote.loop.tlscertpath=/its/a/very/looooooonnnnnnggg/direcory/name/with/high/depth/path/mainnet/mytls.cert

elbandi avatar Nov 09 '21 19:11 elbandi