bitcoin core – How do I configure BTCPayServer to use an alternate datadir and avoid ‘cannot open config file’ errors?
similar:
Ubuntu Linux, bitcoin datadir cannot be set to a folder on another drive
and
I can’t launch Bitcoin on my Raspberry Pi. Why do I need settings.json.tmp when I didn’t need it before?
I am configuring BTCPayServer to use a datadir other than my root directory because there is not enough space in the root directory for a cleaned-up BTCPayServer node. When I configure and run BTCPayServer, I am always logged in as root, and root (obviously) has access to my alternate directory. This can be checked by running: ls -l altdatadir
is output (usually edited).
drwxr-xr-x 7 root root 4096 Mar 28 16:23 altdatadir
I applied the fallback path to the appropriate line. docker-fragments/bitcoin.yml
.
When I run the setup script everything seems to start, but when I call bitcoin-cli.sh it says it will restart with a unique hash. when i run docker logs (unique hash)
is output (usually edited).
Error: Settings file could not be written:
- Error: Unable to open settings file /media/$USER/altdatadir/.bitcoin/settings.json.tmp for writing
I assume you are already running as root on the given setup core (since the btcpay server runs as root). This is the only solution to this problem when it appears in a second similar question situation. If not, how do I force BTCPayServer-docker to run as root?
If this is true and I am root when running the core, why can’t I write to directories/files?