How do I configure BTCPayServer to use an alternative datadir and avoid 'Unable to open settings file' Error?

Similar to:

Ubuntu Linux, Unable to set bitcoin datadir to a folder in different drive

and

I can't start bitcoind on Raspberry Pi. Why do I need settings.json.tmp when I didn't need it before?

I am configuring BTCPayServer to use a datadir that is not my root directory because I don't have enough space on my root directory for my pruned BTCPayServer Node. When configuring and running BTCPayServer I am logged in as root the entire time, root (obviously) has access to my alternative directory. This can be verified by running ls -l altdatadir

It outputs (edited to be generic):

drwxr-xr-x 7 root root 4096 Mar 28 16:23 altdatadir

I applied the alternate paths to the appropriate lines in docker-fragments/bitcoin.yml.

When I run the setup script everything appears to start, however if I try to call bitcoin-cli.sh it tells me it is restarting along with its unique hash. When I run docker logs (unique hash) it outputs (edited to be generic):

Error: Settings file could not be written:
 - Error: Unable to open settings file /media/$USER/altdatadir/.bitcoin/settings.json.tmp for writing

I am assuming under the given setup core is already being run as root (because btcpay server is being run as root) , which is the only given solution to this issue when it has appeared in the 2nd similar question's situation. If it is not the case how do I force BTCPayServer-docker to run it as root?

If it is the case and I am root when running core, why do I not have the ability to write into the directory/files?



from Recent Questions - Bitcoin Stack Exchange https://ift.tt/olWcgSv
via IFTTT

Popular posts from this blog

Bitcoin Mining Could Be Strengthening The Ruble, Russian Central Bank Says

Crypto Exec Warns Tokenization Is Moving Faster Than Expected

Bitwise Clients Pour $69M Into Solana as Bulls Fight to Reclaim $200 Resistance Zone