From 785e797ef89eb5bd3cb148f0fcd06f0921f9c93f Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 8 Oct 2020 14:57:48 +0200 Subject: [PATCH 1/2] scripts: install bitcoind binary from docker image Because the bitcoind mirror is extremely slow, we spend at least 2 to 3 minutes of each bitcoind related test on just downloading the binary. We can achieve the same result by just pulling the docker image and extracting the binary from that. --- scripts/install_bitcoind.sh | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/scripts/install_bitcoind.sh b/scripts/install_bitcoind.sh index 638df9e0..756fb8af 100755 --- a/scripts/install_bitcoind.sh +++ b/scripts/install_bitcoind.sh @@ -2,17 +2,9 @@ set -ev -export BITCOIND_VERSION=0.20.0 - -if sudo cp ~/bitcoin/bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind -then - echo "found cached bitcoind" -else - mkdir -p ~/bitcoin && \ - pushd ~/bitcoin && \ - wget https://bitcoin.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \ - tar xvfz bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz && \ - sudo cp ./bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind && \ - popd -fi +BITCOIND_VERSION=${BITCOIN_VERSION:-0.20.1} +docker pull ruimarinho/bitcoin-core:$BITCOIND_VERSION +CONTAINER_ID=$(docker create ruimarinho/bitcoin-core:$BITCOIND_VERSION) +sudo docker cp $CONTAINER_ID:/opt/bitcoin-$BITCOIND_VERSION/bin/bitcoind /usr/local/bin/bitcoind +docker rm $CONTAINER_ID From e8253479d577682768f179e5c852e270ecd84d4e Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 8 Oct 2020 14:58:49 +0200 Subject: [PATCH 2/2] Travis+GitHub: update to bitcoind 0.20.1, remove cache With this commit we use the same version of bitcoind in all tests and also remove the caches for the binary as docker has its own cache. --- .github/workflows/main.yml | 10 +--------- .travis.yml | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9fac9b0b..5a6f7d70 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ env: GOCACHE: /home/runner/work/go/pkg/build GOPATH: /home/runner/work/go DOWNLOAD_CACHE: /home/runner/work/download_cache - BITCOIN_VERSION: 0.19.1 + BITCOIN_VERSION: 0.20.1 GO_VERSION: 1.15.2 jobs: @@ -236,14 +236,6 @@ jobs: with: go-version: '~${{ env.GO_VERSION }}' - - name: bitcoin cache - uses: actions/cache@v1 - with: - path: /home/runner/bitcoin/bitcoin-${{ env.BITCOIN_VERSION }}/bin - key: lnd-${{ runner.os }}-bitcoin-${{ env.BITCOIN_VERSION }} - restore-keys: | - lnd-${{ runner.os }}-bitcoin-${{ env.BITCOIN_VERSION }} - - name: install bitcoind run: ./scripts/install_bitcoind.sh diff --git a/.travis.yml b/.travis.yml index 14de93d4..5479a832 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: go cache: directories: - - ~/bitcoin/bitcoin-0.19.1/bin - $DOWNLOAD_CACHE - $GOCACHE - $GOPATH/pkg/mod @@ -23,6 +22,7 @@ env: global: - GOCACHE=$HOME/.go-build - DOWNLOAD_CACHE=$HOME/download_cache + - BITCOIN_VERSION=0.20.1 sudo: required