BTCPayserver suggests to deploy and use the docker configuration in production.
The docker configuration is available via docker-compose: https://github.com/btcpayserver/btcpayserver-docker
BTCPay depends on several pieces of infrastructure, mainly:
- A lightweight block explorer (NBXplorer),
- A database (PostgreSQL or SQLite),
- A full node (eg. Bitcoin Core)
There can be more dependencies if you support more than just standard Bitcoin transactions, including:
- LitecoinD and other coin daemons
It seems the bitcoin client needs to be installed and synced locally, therefore I am a bit concerned about storage. On this issue the docker setup has some scripts to prune the synced data to approx 100GB: https://github.com/btcpayserver/btcpayserver-docker#how-i-can-prune-my-nodes
I am also concerned how to make this setup play nicely with our infrastructure.
It would be nice if we can have an idea of the setup that BTC is currently running for us. What are the requirements? How many coins are supported?
Update: that service was setup at lunanode by @hiro in 2021, but never integrated properly with TPA infrastructure, so it's in an unknown state. We should rebuild it inside our infra, following this procedure:
backup the actual btcpayserver
create a VM inside our infra, using our normal setup procedures (so we have backups, monitoring, etc)
deploy the thing using their Docker procedures (which target ubuntu 18.04, but that we could possibly deploy on bullseye?), things to watch out for:
- that thing probably installs postgresql and docker and all sorts of things, maybe try to trim that down to debian packages as much as possible?
- this generates a docker-compose.yaml file (!?), see what it actually does?
- consider just using the
./build.shcommand to generate the compose file and start from there? see what does btcpay-setup.sh do?
- note that we absolutely need to have some sort of "fragment" to keep the blockchain from exploding in size. the current bitcoin blockchain is reaching 400GB and growing exponentially. it seems like we're using the opt-save-storage-s fragment which keeps it under 50GB
restore the backup onto the new server, things to watch out for:
- will this take over payments?
add btcpay.torproject.org to DNS, deprecate the
flip the donate.tpo things so that they point to the
.org, see tpo/web/donate-static!76 (merged) and the full migration procedure
test donations on new server
retire btcpay.torproject.net (see procedure below)
fix credentials in password manager (remove old, tweak new, possibly audit)
automate upgrades, backups (including postgresql?) (#40763)
server retirement procedure:
retire the host in fabric (no backups, not in puppet, nothing to do)
remove from LDAP with
ldapvi(not in LDAP)
power-grep (removed from torproject.net zone)
remove from tor-passwords (done, also reset the root pass on btcpayserver-02, which was missing)
remove from DNSwl (N/A)
remove from docs (nothing found)
remove from racks (let's wait two more weeks)
remove from reverse DNS (not set)
current specs of the machine:
ubuntu@btcpay:~$ df -h / /dev/vdc Filesystem Size Used Avail Use% Mounted on /dev/vda1 20G 9.3G 11G 49% / /dev/vdc 59G 49G 7.0G 88% /var/lib/docker/volumes/generated_bitcoin_datadir/_data/blocks ubuntu@btcpay:~$ uptime 19:46:00 up 37 days, 8:36, 1 user, load average: 0.13, 0.27, 0.15 ubuntu@btcpay:~$ free -h total used free shared buff/cache available Mem: 2.0G 1.1G 114M 9.2M 799M 684M Swap: 1.0G 682M 341M ubuntu@btcpay:~$ uname -a Linux btcpay 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
in other words, we might want to give it 60GB of spinning rust (which is 10GB over the "50GB" we are trimming to), but otherwise fairly standard.
in the current setup, we seem to have the following components setup (looking at
- nginx 1.16 (based on the official docker image)
- nginx-gen (which is some container based on docker-gen, which ... generates config files?)
- btcpayserver (based on their image of course)
- bitcoind (based on btcpayserver/bitcoin docker image)
- nbx explorer 2.2.5 (based on nicolasdorier/nbxplorer
- lnd_bitcoin (for the "lighting network", based on their image)
- bitcoin_rtl (based on shahanafarooqui/rtl, a webapp for the lightning network)
- postgresql 9.6.20 (!? based on the official image
- btcpayserver/tor (yes, they have a tor container image)
- tor-gen, also based on docker-gen to generate a config for the above container