-
Notifications
You must be signed in to change notification settings - Fork 35
/
test-run-regtest.sh
executable file
·49 lines (38 loc) · 1.11 KB
/
test-run-regtest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -x
function cleanup {
kill -15 $BTCPID
}
trap cleanup EXIT
# We are currently using Omni Core since it a superset of Bitcoin Core
BITCOIND=copied-artifacts/src/omnicored
DATADIR=build/regtest-datadir
LOGDIR=logs
OMNILOG=/tmp/omnicore.log
# Assume bitcoind built elsewhere and copied without x permission
chmod +x $BITCOIND
# Setup bitcoin conf and data dir
mkdir -p $DATADIR
cp -n bitcoin.conf $DATADIR
# setup logging
mkdir -p $LOGDIR
touch $OMNILOG
ln -sf $OMNILOG $LOGDIR/omnicore.log
# Remove all regtest data
rm -rf $DATADIR/regtest
# Run bitcoind in regtest mode
$BITCOIND -regtest -datadir=$DATADIR \
-addresstype=legacy -experimental-btc-balances=1 \
-peerbloomfilters \
-paytxfee=0.0001 -minrelaytxfee=0.00001 \
-limitancestorcount=750 -limitdescendantcount=750 > $LOGDIR/bitcoin.log &
BTCSTATUS=$?
BTCPID=$!
echo $BITCOIND started return code $BTCSTATUS pid $BTCPID
# Give server some time to start
# sleep 30
# Run integration tests
echo "Running Bitcoin Core RPC integration tests in RegTest mode..."
./gradlew regTest --scan --info --stacktrace
GRADLESTATUS=$?
exit $GRADLESTATUS