feat: First steps into regtest integration tests

This commit is contained in:
Taranto 2020-04-07 11:34:35 +01:00 committed by Josh Harvey
parent 7152230d08
commit 4425ccce58
3 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1 @@
### Early experiments in regtest

View file

@ -0,0 +1,35 @@
#!/bin/bash
PREFIX_W1='docker exec --user bitcoin bitcoin-server bitcoin-cli -rpcwallet=wallet1.dat -regtest '
PREFIX_W2='docker exec --user bitcoin bitcoin-server bitcoin-cli -rpcwallet=wallet2.dat -regtest '
# Create address and generate mine blocks
ADDRESS_1=`$PREFIX_W1 getnewaddress`
ADDRESS_2=`$PREFIX_W2 getnewaddress`
$PREFIX_W1 generatetoaddress 101 $ADDRESS_1 > /dev/null 2>&1
echo -e 'Wallet 1 balance'
$PREFIX_W1 getwalletinfo | grep balance
echo -e '\nWallet 2 balance'
$PREFIX_W2 getwalletinfo | grep balance
# Wallet one has one UTXO, so this also tests change
echo -e '\n\nCreate send\n'
$PREFIX_W1 sendtoaddress $ADDRESS_2 0.3 > /dev/null 2>&1
echo -e 'Wallet 1 balance'
$PREFIX_W1 getwalletinfo | grep balance
echo -e '\nWallet 2 balance'
$PREFIX_W2 getwalletinfo | grep balance
echo -e '\n\nMine one block \n'
$PREFIX_W1 generatetoaddress 1 $ADDRESS_1 > /dev/null 2>&1
echo -e 'Wallet 1 balance'
$PREFIX_W1 getwalletinfo | grep balance
echo -e '\nWallet 2 balance'
$PREFIX_W2 getwalletinfo | grep balance

View file

@ -0,0 +1,7 @@
#!/bin/bash
docker run --rm --name bitcoin-server -it ruimarinho/bitcoin-core \
-regtest=1 \
-wallet=wallet1.dat \
-wallet=wallet2.dat