Skip to content

Commit 192536d

Browse files
authored
Merge pull request #117 from renproject/update-bitcoin-client
Fix: Update bitcoin client for race condition fixed in later release
2 parents ae88550 + 58461fa commit 192536d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

infra/bitcoin/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ RUN apt-get install --yes curl
66
# bitcoind PPA is unmaintained, so we download it from the bitcoincore website.
77
# This can sometimes stall, which can be fixed by killing and restarting the
88
# build.
9-
RUN curl https://bitcoincore.org/bin/bitcoin-core-0.19.1/bitcoin-0.19.1-x86_64-linux-gnu.tar.gz | tar -xz
10-
RUN mv ./bitcoin-0.19.1 /app
9+
RUN curl https://bitcoincore.org/bin/bitcoin-core-0.21.0/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz | tar -xz
10+
RUN mv ./bitcoin-0.21.0 /app
1111
RUN chmod +x /app/bin/bitcoind
1212
RUN chmod +x /app/bin/bitcoin-cli
1313

infra/bitcoin/run.sh

+10-7
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,31 @@ ADDRESS=$1
33
PRIV_KEY=$2
44

55
# Start
6-
/app/bin/bitcoind
7-
sleep 10
6+
/app/bin/bitcoind -regtest -daemon
7+
sleep 20
88

99
# Print setup
1010
echo "BITCOIN_ADDRESS=$ADDRESS"
1111

12+
# Create wallet
13+
/app/bin/bitcoin-cli createwallet "testwallet"
14+
1215
# Import the address
13-
/app/bin/bitcoin-cli importaddress $ADDRESS
16+
/app/bin/bitcoin-cli -regtest importaddress $ADDRESS
1417

1518
# Import the private key to spend UTXOs
16-
/app/bin/bitcoin-cli importprivkey $PRIV_KEY
19+
/app/bin/bitcoin-cli -regtest importprivkey $PRIV_KEY
1720

1821
# Generate enough block to pass the maturation time
19-
/app/bin/bitcoin-cli generatetoaddress 101 $ADDRESS
22+
/app/bin/bitcoin-cli -regtest generatetoaddress 101 $ADDRESS
2023

2124
# Simulate mining
2225
while :
2326
do
2427
# generate new btc to the address
25-
/app/bin/bitcoin-cli generatetoaddress 1 $ADDRESS
28+
/app/bin/bitcoin-cli -regtest generatetoaddress 1 $ADDRESS
2629
sleep 5
2730
# send tx to own address while paying fee to the miner
28-
/app/bin/bitcoin-cli sendtoaddress $ADDRESS 0.5 "" "" true
31+
/app/bin/bitcoin-cli -regtest sendtoaddress $ADDRESS 1 "" "" true
2932
sleep 5
3033
done

0 commit comments

Comments
 (0)