Context
Bitkit Android is adding BTCPay wallet-connection support (bitkit-android#961) — the user scans a SamRock setup link from a BTCPay store and Bitkit registers an on-chain receive descriptor with that store. Testing this flow locally requires an NBXplorer + BTCPay Server pair pointed at the same regtest chain Bitkit already uses.
bitkit-docker doesn't have anything BTCPay-related today. While bringing PR #961 up locally I ended up writing a small overlay compose file that reuses this repo's existing bitcoind and postgres. It would be useful to land that here so anyone testing BTCPay against Bitkit (or working on follow-up features like Boltz, payouts, etc.) gets a working stack with one command.
Proposed addition
A new docker-compose.btcpay.yml overlay that adds two services and reuses what's already here:
services:
nbxplorer:
image: nicolasdorier/nbxplorer:2.6.7
container_name: nbxplorer
restart: unless-stopped
depends_on: [bitcoind, postgres]
ports: ["32838:32838"]
environment:
NBXPLORER_NETWORK: regtest
NBXPLORER_CHAINS: "btc"
NBXPLORER_BTCRPCURL: http://bitcoind:43782
NBXPLORER_BTCRPCUSER: polaruser
NBXPLORER_BTCRPCPASSWORD: polarpass
NBXPLORER_BTCNODEENDPOINT: bitcoind:39388
NBXPLORER_BIND: 0.0.0.0:32838
NBXPLORER_NOAUTH: "true"
NBXPLORER_POSTGRES: "Host=postgres;Port=5432;Database=nbxplorer;Username=postgres;Password=postgres"
btcpayserver:
image: btcpayserver/btcpayserver:2.3.9
container_name: btcpayserver
restart: unless-stopped
depends_on: [nbxplorer, postgres]
ports: ["14142:14142"]
environment:
BTCPAY_NETWORK: regtest
BTCPAY_BIND: 0.0.0.0:14142
BTCPAY_ROOTPATH: /
BTCPAY_PROTOCOL: http
BTCPAY_CHAINS: "btc"
BTCPAY_BTCEXPLORERURL: http://nbxplorer:32838/
BTCPAY_POSTGRES: "Host=postgres;Port=5432;Database=btcpay;Username=postgres;Password=postgres"
BTCPAY_EXPLORERPOSTGRES: "Host=postgres;Port=5432;Database=nbxplorer;Username=postgres;Password=postgres"
Used as: docker compose -f docker-compose.yml -f docker-compose.btcpay.yml up -d.
Gotchas I hit while validating it
-
Postgres needs the BTCPay/NBXplorer databases bootstrapped. The existing sql/v0_create_vss_db.sql only creates the VSS table on the default postgres DB. On a clean down -v + up, both BTCPay and NBXplorer crash with:
Error while trying to connection to explorer.postgres: 3D000:
database "nbxplorer" does not exist
Fix: ship a second init script (e.g. sql/v1_create_btcpay_dbs.sql) with CREATE DATABASE nbxplorer; and CREATE DATABASE btcpay; and mount it alongside the VSS one. Postgres runs everything in /docker-entrypoint-initdb.d/ on first boot.
-
No healthcheck on btcpayserver. First boot takes ~60s (Entity Framework migrations); without a healthcheck, scripts that want to wait for BTCPay to be ready have to poll :14142 themselves.
-
Android emulator port plumbing isn't obvious. Bitkit's setup-link parser only accepts loopback / RFC1918 hosts for HTTP. From an emulator that means either using 10.0.2.2:14142 directly, or:
adb reverse tcp:60001 tcp:60001 # electrs
adb reverse tcp:14142 tcp:14142 # btcpay
Worth a short README section alongside the existing testing guides.
Suggested follow-ups
In priority order, smallest to biggest:
Happy to send a PR for items 1-4 if useful; the helper script is the bigger piece and may want a separate issue.
Context
Bitkit Android is adding BTCPay wallet-connection support (bitkit-android#961) — the user scans a SamRock setup link from a BTCPay store and Bitkit registers an on-chain receive descriptor with that store. Testing this flow locally requires an NBXplorer + BTCPay Server pair pointed at the same regtest chain Bitkit already uses.
bitkit-dockerdoesn't have anything BTCPay-related today. While bringing PR #961 up locally I ended up writing a small overlay compose file that reuses this repo's existingbitcoindandpostgres. It would be useful to land that here so anyone testing BTCPay against Bitkit (or working on follow-up features like Boltz, payouts, etc.) gets a working stack with one command.Proposed addition
A new
docker-compose.btcpay.ymloverlay that adds two services and reuses what's already here:Used as:
docker compose -f docker-compose.yml -f docker-compose.btcpay.yml up -d.Gotchas I hit while validating it
Postgres needs the BTCPay/NBXplorer databases bootstrapped. The existing
sql/v0_create_vss_db.sqlonly creates the VSS table on the defaultpostgresDB. On a cleandown -v+up, both BTCPay and NBXplorer crash with:Fix: ship a second init script (e.g.
sql/v1_create_btcpay_dbs.sql) withCREATE DATABASE nbxplorer;andCREATE DATABASE btcpay;and mount it alongside the VSS one. Postgres runs everything in/docker-entrypoint-initdb.d/on first boot.No healthcheck on
btcpayserver. First boot takes ~60s (Entity Framework migrations); without a healthcheck, scripts that want to wait for BTCPay to be ready have to poll:14142themselves.Android emulator port plumbing isn't obvious. Bitkit's setup-link parser only accepts loopback / RFC1918 hosts for HTTP. From an emulator that means either using
10.0.2.2:14142directly, or:Worth a short README section alongside the existing testing guides.
Suggested follow-ups
In priority order, smallest to biggest:
nbxplorerandbtcpay.btcpayserver(HTTP GET on/).BTCPaysection toREADME.mdwith the bring-up command and the emulator port-forwarding notes.scripts/setup-btcpay-store.sh) that, once BTCPay is healthy, registers an admin user via the API, creates a regtest store, enables on-chain BTC, and prints a SamRock setup URL ready to paste/deeplink into Bitkit — turning the 10-step manual setup into one command.Happy to send a PR for items 1-4 if useful; the helper script is the bigger piece and may want a separate issue.