Open dstadulis opened 3 months ago
If btcd isn't the ideal location for this issue, it will be moved
the main pitch is: Don't you want to live in a world where we can tell anyone, regardless of their OS:
Run this in your terminal
<<<"lnd-mode=remote" >> $(litd --conf-prefix)/lit.conf
Rather than
Ok if you are using linux
<<<"lnd-mode=remote" >> ~/.lit/lit.conf
oh you're on macOS? oh then you should do<<<"lnd-mode=remote" >> ~/Library/Application Support/Lit/lit.conf
Background / Motivation
Currently daemons using btcutil (litd, loop, pool, tapd, lnd) have operating-system specific configuration directory paths.
1) Anytime guides are written or the conf file needs to addressed, there's a need to preface where these files are located https://github.com/lightninglabs/lightning-terminal/blob/ba81aaf0d797844efc72a20dcdb71edc9d5b4a9b/doc/config-lnd-remote.md?plain=1#L27-L32
2) and sometimes guides are have incomplete / error-prone conf information https://github.com/lightninglabs/docs.lightning.engineering/blob/261a1b8ebce1b5d1d027eb7f98c391031b67d562/lightning-network-tools/lightning-terminal/run-litd.md?plain=1#L21-L22
3) Other node-automation services have to manage determining where to place the conf file e.g. produce
uname
bash scripts.4) If the lnd/litd process has been started with a
--lnddir
set at runtime, the conf file location won't match what's listed in the guidesSolution
A CLI flag which reports
btcd/btcutil
's appDataDir would enable programmatically obtaining the config-directory pathe.g.
litd --conf-prefix
would return the configuration-file directoryEnabling programmatic access:
If
--conf-prefix
is considered a departure from existing nomenclature standards, An alternative name might be--lnd-dir-prefix
Obviate the human in the loop to determine the location!
References
Homebrew uses a similar flag
and is often used