install_bitcoind.sh
1 #!/usr/bin/env bash 2 3 set -ev 4 5 BITCOIND_VERSION=$1 6 7 # Useful for testing RCs: e.g. TAG_SUFFIX=.0rc1, DIR_SUFFIX=.0rc1 8 TAG_SUFFIX= 9 DIR_SUFFIX=.0 10 11 # Useful for testing against an image pushed to a different Docker repo. 12 REPO=lightninglabs/bitcoin-core 13 14 if [ -z "$BITCOIND_VERSION" ]; then 15 echo "Must specify a version of bitcoind to install." 16 echo "Usage: install_bitcoind.sh <version>" 17 exit 1 18 fi 19 20 docker pull ${REPO}:${BITCOIND_VERSION}${TAG_SUFFIX} 21 CONTAINER_ID=$(docker create ${REPO}:${BITCOIND_VERSION}${TAG_SUFFIX}) 22 sudo docker cp $CONTAINER_ID:/opt/bitcoin-${BITCOIND_VERSION}${DIR_SUFFIX}/bin/bitcoind /usr/local/bin/bitcoind 23 docker rm $CONTAINER_ID