Skip to content

Commit

Permalink
feat: add nbxplorer (#40)
Browse files Browse the repository at this point in the history
* feat: add nbxplorer

* chore: move nbxplorer version to .env
  • Loading branch information
jackstar12 authored Oct 10, 2024
1 parent ee9ba83 commit 535dbc6
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 15 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ ESPLORA_IMAGE=boltz/esplora:latest
OTTERSCAN_IMAGE=otterscan/otterscan:latest
RIF_RELAY_IMAGE=boltz/rif-relay:latest
NGINX_IMAGE=nginx:alpine
NBXPLORER_IMAGE=nicolasdorier/nbxplorer:2.5.4
75 changes: 60 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ x-services:
volumes_from:
- bitcoind:ro
healthcheck:
test: [ "CMD-SHELL", "lncli --network=regtest --rpcserver=$$HOSTNAME --network=regtest getinfo" ]
test:
[
"CMD-SHELL",
"lncli --network=regtest --rpcserver=$$HOSTNAME --network=regtest getinfo",
]
interval: 1s
timeout: 1s
retries: 30
Expand Down Expand Up @@ -69,7 +73,7 @@ x-services:
volumes_from:
- bitcoind:ro
healthcheck:
test: [ "CMD", "lightning-cli", "--network=regtest", "getinfo" ]
test: ["CMD", "lightning-cli", "--network=regtest", "getinfo"]
timeout: 1s
retries: 20
interval: 1s
Expand All @@ -80,7 +84,7 @@ services:
<<: *base-scripts
restart: no
container_name: boltz-cleanup
entrypoint: [ "/bin/bash", "-c", "/cleanup.sh" ]
entrypoint: ["/bin/bash", "-c", "/cleanup.sh"]
profiles: ["default", "ci"]

postgres:
Expand All @@ -101,6 +105,8 @@ services:
profiles: ["default", "ci"]
ports:
- 5432:5432
expose:
- 5432

boltz-backend:
hostname: boltz
Expand All @@ -122,7 +128,7 @@ services:
volumes_from:
- bitcoind:ro
healthcheck:
test: [ "CMD-SHELL", "timeout 1 bash -c 'echo > /dev/tcp/127.0.0.1/9000'" ]
test: ["CMD-SHELL", "timeout 1 bash -c 'echo > /dev/tcp/127.0.0.1/9000'"]
timeout: 1s
retries: 10
interval: 1s
Expand All @@ -142,7 +148,7 @@ services:
volumes:
- nginx-data:/etc/nginx/conf.d
healthcheck:
test: [ "CMD-SHELL", "curl http://localhost:9001/version" ]
test: ["CMD-SHELL", "curl http://localhost:9001/version"]
timeout: 1s
retries: 10
interval: 1s
Expand Down Expand Up @@ -193,7 +199,7 @@ services:
ports:
- 8545:8545
healthcheck:
test: [ "CMD-SHELL", "timeout 1 bash -c 'echo > /dev/tcp/127.0.0.1/8545'" ]
test: ["CMD-SHELL", "timeout 1 bash -c 'echo > /dev/tcp/127.0.0.1/8545'"]
timeout: 1s
retries: 3
interval: 1s
Expand All @@ -208,7 +214,7 @@ services:
anvil:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "curl -s localhost:8090/chain-info" ]
test: ["CMD-SHELL", "curl -s localhost:8090/chain-info"]
timeout: 1s
retries: 10
interval: 2s
Expand All @@ -235,15 +241,24 @@ services:
cleanup:
condition: service_completed_successfully
expose:
- 18443
- 18444
ports:
- 18443:18443
- 18444:18444
- 29000:29000
- 29001:29001
volumes:
- bitcoin-data:/root/.bitcoin
healthcheck:
test: [ "CMD", "bitcoin-cli", "--rpccookiefile=/root/.bitcoin/regtest/.cookie", "-regtest", "getblockchaininfo" ]
test:
[
"CMD",
"bitcoin-cli",
"--rpccookiefile=/root/.bitcoin/regtest/.cookie",
"-regtest",
"getblockchaininfo",
]
timeout: 1s
retries: 1
interval: 1s
Expand All @@ -267,7 +282,7 @@ services:
volumes:
- elements-data:/home/elements/.elements
healthcheck:
test: [ "CMD", "elements-cli", "-getinfo" ]
test: ["CMD", "elements-cli", "-getinfo"]
timeout: 1s
retries: 1
interval: 1s
Expand Down Expand Up @@ -321,7 +336,8 @@ services:
<<: *base-scripts
restart: no
container_name: boltz-bitcoind-init
entrypoint: [ "/bin/bash", "-c", "source /etc/profile.d/utils.sh && bitcoind-init" ]
entrypoint:
["/bin/bash", "-c", "source /etc/profile.d/utils.sh && bitcoind-init"]
depends_on:
- bitcoind
profiles: ["default", "ci"]
Expand All @@ -330,7 +346,8 @@ services:
<<: *base-scripts
restart: no
container_name: boltz-regtest-start
entrypoint: [ "/bin/bash", "-c", "source /etc/profile.d/utils.sh && regtest-start" ]
entrypoint:
["/bin/bash", "-c", "source /etc/profile.d/utils.sh && regtest-start"]
depends_on:
bitcoind-init:
condition: service_completed_successfully
Expand Down Expand Up @@ -367,7 +384,7 @@ services:
depends_on:
bitcoind-init:
condition: service_completed_successfully
entrypoint: [ "electrs-bitcoin" ]
entrypoint: ["electrs-bitcoin"]
command:
- --electrum-rpc-addr
- electrs:19001
Expand All @@ -379,7 +396,7 @@ services:
- regtest
- --jsonrpc-import
healthcheck:
test: [ "CMD-SHELL", "curl -s $(hostname):3002/blocks/tip/height" ]
test: ["CMD-SHELL", "curl -s $(hostname):3002/blocks/tip/height"]
timeout: 1s
retries: 5
interval: 2s
Expand All @@ -399,7 +416,7 @@ services:
depends_on:
elementsd:
condition: service_healthy
entrypoint: [ "electrs-liquid" ]
entrypoint: ["electrs-liquid"]
command:
- --electrum-rpc-addr
- electrs-liquid:19002
Expand All @@ -417,7 +434,7 @@ services:
- regtest
- --jsonrpc-import
healthcheck:
test: [ "CMD-SHELL", "curl -s $(hostname):3003/blocks/tip/height" ]
test: ["CMD-SHELL", "curl -s $(hostname):3003/blocks/tip/height"]
timeout: 15s
retries: 10
interval: 2s
Expand Down Expand Up @@ -458,6 +475,34 @@ services:
- 5100:80
profiles: ["default"]

nbxplorer:
container_name: boltz-nbxplorer
image: ${NBXPLORER_IMAGE}
restart: unless-stopped
ports:
- "32838:32838"
expose:
- "32838"
environment:
NBXPLORER_NETWORK: regtest
NBXPLORER_CHAINS: "btc"
NBXPLORER_BTCRPCURL: http://bitcoind:18443/
NBXPLORER_BTCRPCCOOKIEFILE: /root/.bitcoin/regtest/.cookie
NBXPLORER_BTCNODEENDPOINT: bitcoind:18444
NBXPLORER_BIND: 0.0.0.0:32838
NBXPLORER_MINGAPSIZE: 5
NBXPLORER_MAXGAPSIZE: 10
NBXPLORER_VERBOSE: 1
NBXPLORER_POSTGRES: User ID=boltz;Password=boltz;Include Error Detail=true;Host=postgres;Port=5432;Database=nbxplorer
NBXPLORER_EXPOSERPC: 1
NBXPLORER_NOAUTH: 1
depends_on:
bitcoind-init:
condition: service_completed_successfully
volumes:
- bitcoin-data:/root/.bitcoin
profiles: ["btcpay"]

volumes:
boltz-data:
name: boltz-backend-data
Expand Down

0 comments on commit 535dbc6

Please sign in to comment.