lightninglabs / faraday

Lightning Channel Management & Optimization Tool
MIT License
130 stars 29 forks source link

Unable to define --macaroonpath when starting service #191

Closed joshfix closed 2 months ago

joshfix commented 2 months ago

I first noticed this behavior with litd, but it also exists in Faraday. Faraday fails to start if you define the --macaroonpath argument.

Expected behavior

I would expect to be able to define any directory for macaroonpath and have that directory be used to store faraday's macaroons. Per the usage help text:

Path to write the macaroon for faraday's RPC and REST services if it doesn't exist. (default: /Users/joshfix/Library/ApplicationSupport/Faraday/mainnet/faraday.macaroon)

Actual behavior

When specifying the macaroon path, the service fails to start with the error:

Error starting faraday: error validating config: faradaydir overwrites macaroonpath, please only set one value

This error occurs even when not specifying a faradaydir value.

To reproduce

Start the service without providing the macaroonpath or faradaydir flags and observe that the service starts as expected:

$ ./faraday --lnd.macaroonpath=/path/admin.macaroon --lnd.tlscertpath=/path/tls.cert --lnd.rpcserver=127.0.0.1:10009 --network=regtest
2024-08-14 11:24:28.612 [INF] FRDY: Generating TLS certificates...
2024-08-14 11:24:28.616 [INF] FRDY: Done generating TLS certificates
2024-08-14 11:24:28.713 [INF] FRPC: Starting gRPC listener
2024-08-14 11:24:28.713 [INF] FRPC: gRPC server listening on 127.0.0.1:8465
2024-08-14 11:24:28.713 [INF] FRPC: REST proxy disabled

Then attempt to start the service with the maracroonpath flag and not the faradaydir flag and observe the error:

./faraday --lnd.macaroonpath=/path/admin.macaroon --lnd.tlscertpath=/path/tls.cert --lnd.rpcserver=127.0.0.1:10009 --network=regtest --macaroonpath=/macpath                 
Error starting faraday: error validating config: faradaydir overwrites macaroonpath, please only set one value%  

System information

Faraday is running standalone, however, I have observed similar behavior with litd. I am using Faraday v0.2.13 cloned from the repo and compiled locally.

ellemouton commented 2 months ago

Thanks for the issue @joshfix 🙏

I just opened #192 which should solve this issue