File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ RUN apt-get install --yes curl
6
6
# bitcoind PPA is unmaintained, so we download it from the bitcoincore website.
7
7
# This can sometimes stall, which can be fixed by killing and restarting the
8
8
# 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
11
11
RUN chmod +x /app/bin/bitcoind
12
12
RUN chmod +x /app/bin/bitcoin-cli
13
13
Original file line number Diff line number Diff line change @@ -3,28 +3,31 @@ ADDRESS=$1
3
3
PRIV_KEY=$2
4
4
5
5
# Start
6
- /app/bin/bitcoind
7
- sleep 10
6
+ /app/bin/bitcoind -regtest -daemon
7
+ sleep 20
8
8
9
9
# Print setup
10
10
echo " BITCOIN_ADDRESS=$ADDRESS "
11
11
12
+ # Create wallet
13
+ /app/bin/bitcoin-cli createwallet " testwallet"
14
+
12
15
# Import the address
13
- /app/bin/bitcoin-cli importaddress $ADDRESS
16
+ /app/bin/bitcoin-cli -regtest importaddress $ADDRESS
14
17
15
18
# Import the private key to spend UTXOs
16
- /app/bin/bitcoin-cli importprivkey $PRIV_KEY
19
+ /app/bin/bitcoin-cli -regtest importprivkey $PRIV_KEY
17
20
18
21
# 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
20
23
21
24
# Simulate mining
22
25
while :
23
26
do
24
27
# generate new btc to the address
25
- /app/bin/bitcoin-cli generatetoaddress 1 $ADDRESS
28
+ /app/bin/bitcoin-cli -regtest generatetoaddress 1 $ADDRESS
26
29
sleep 5
27
30
# 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
29
32
sleep 5
30
33
done
You can’t perform that action at this time.
0 commit comments