make bitcoin health check dependent on blockheight
This commit is contained in:
parent
c32782583f
commit
c63622b8a4
|
@ -101,7 +101,7 @@ discovery.type=single-node
|
||||||
DISABLE_SECURITY_DASHBOARDS_PLUGIN=true
|
DISABLE_SECURITY_DASHBOARDS_PLUGIN=true
|
||||||
|
|
||||||
# bitcoind container stuff
|
# bitcoind container stuff
|
||||||
RPC_AUTH='67a3db6d29c5a1561052cfd98a68d386$30e1de363f5b6eecf54196c1e754dae84f10eadb03804249682579401c86589e'
|
RPC_AUTH='7c68e5fcdba94a366bfdf629ecc676bb$0d0fc087c3bf7f068f350292bf8de1418df3dd8cb31e35682d5d3108d601002b'
|
||||||
RPC_USER=bitcoin
|
RPC_USER=bitcoin
|
||||||
RPC_PASS=bitcoin
|
RPC_PASS=bitcoin
|
||||||
RPC_PORT=18443
|
RPC_PORT=18443
|
||||||
|
|
|
@ -154,9 +154,18 @@ services:
|
||||||
image: polarlightning/bitcoind:26.0
|
image: polarlightning/bitcoind:26.0
|
||||||
container_name: bitcoin
|
container_name: bitcoin
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
stop_grace_period: '5m'
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "bitcoin-cli", "-chain=regtest", "-rpcport=${RPC_PORT}", "-rpcuser=${RPC_USER}", "-rpcpassword=${RPC_PASS}", "getblockchaininfo"]
|
test: >
|
||||||
|
bash -c '
|
||||||
|
set -e
|
||||||
|
blockcount=$$(bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} getblockcount 2>/dev/null)
|
||||||
|
if (( blockcount <= 0 )); then
|
||||||
|
bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} generatetoaddress 10 ${LND_ADDR}
|
||||||
|
bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} generatetoaddress 10 ${STACKER_LND_ADDR}
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
'
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
Loading…
Reference in New Issue