2019-05-23 02:51:58 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -ev
|
2019-05-22 07:58:50 +02:00
|
|
|
|
2024-03-15 12:54:29 +01:00
|
|
|
BITCOIND_VERSION=$1
|
|
|
|
|
2024-09-02 18:09:37 +02:00
|
|
|
# Useful for testing RCs: e.g. TAG_SUFFIX=.0rc1, DIR_SUFFIX=.0rc1
|
|
|
|
TAG_SUFFIX=
|
|
|
|
DIR_SUFFIX=.0
|
|
|
|
|
|
|
|
# Useful for testing against an image pushed to a different Docker repo.
|
|
|
|
REPO=lightninglabs/bitcoin-core
|
|
|
|
|
2024-03-15 12:54:29 +01:00
|
|
|
if [ -z "$BITCOIND_VERSION" ]; then
|
|
|
|
echo "Must specify a version of bitcoind to install."
|
|
|
|
echo "Usage: install_bitcoind.sh <version>"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-05-22 07:58:50 +02:00
|
|
|
|
2024-09-02 18:09:37 +02:00
|
|
|
docker pull ${REPO}:${BITCOIND_VERSION}${TAG_SUFFIX}
|
|
|
|
CONTAINER_ID=$(docker create ${REPO}:${BITCOIND_VERSION}${TAG_SUFFIX})
|
|
|
|
sudo docker cp $CONTAINER_ID:/opt/bitcoin-${BITCOIND_VERSION}${DIR_SUFFIX}/bin/bitcoind /usr/local/bin/bitcoind
|
2020-10-08 14:57:48 +02:00
|
|
|
docker rm $CONTAINER_ID
|