Skip to content

Instantly share code, notes, and snippets.

@skwp
Created October 2, 2018 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skwp/012e9c2e8a752fdff1947571bcafbaa6 to your computer and use it in GitHub Desktop.
Save skwp/012e9c2e8a752fdff1947571bcafbaa6 to your computer and use it in GitHub Desktop.
BITCOIN_ECR_IMAGE=$AWS_ACCOUNT.dkr.ecr.$ECR_REGION.amazonaws.com/bitcoin-unlimited:$TAG_bitcoin_ecr_tag
# Log in to ECR so we can pull the docker image
$(/usr/local/bin/aws ecr get-login --region $ECR_REGION --no-include-email)
docker pull $BITCOIN_ECR_IMAGE
docker run -d --name bitcoin \
-p ${BITCOIN_RPC_PORT}-${BITCOIN_PORT}:${BITCOIN_RPC_PORT}-${BITCOIN_PORT} \
--restart unless-stopped \
-v /var/bitcoin:/var/bitcoin \
$BITCOIN_ECR_IMAGE \
bitcoind \
-conf=/root/.bitcoin/bitcoin.conf \
-whitelist=$DOCKER_HOST_ADDRESS/32 \
-server=1 \
-listen=1 \
-datadir=/var/bitcoin ${TAG_bitcoind_flags} \
-rpcuser=${TAG_rpcuser} \
-rpcpassword=${TAG_rpcpassword} \
-net.magic=${TAG_netmagic}
log "Waiting for node to start listening on RPC port $BITCOIN_RPC_PORT and node communication port $BITCOIN_PORT ..."
while ! nc -z localhost $BITCOIN_RPC_PORT ; do
sleep 0.1
done
while ! nc -z localhost $BITCOIN_PORT ; do
sleep 0.1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment