#!/bin/bash
set -x

function cleanup {
    kill -15 $BTCPID
}
trap cleanup EXIT

# Assume bitcoind built elsewhere and coied by Jenkins Copy Artifact plugin
BTCD=copied-artifacts/src/bitcoind
DATADIR=$HOME/.bitcoin
chmod +x $BTCD

# Run Bitcoin on main net mode
mkdir -p $DATADIR
cp -n bitcoin.conf $DATADIR
mkdir -p logs
$BTCD -server -datadir=$DATADIR -debug > logs/bitcoin.log &
BTCSTATUS=$?
BTCPID=$!

# Give server some time to start
sleep 30

# Run consensus tests
echo "Running consensus tests..."
./gradlew integrationTest --tests org.mastercoin.consensus.msc.*
GRADLESTATUS=$?

exit $GRADLESTATUS

#!/bin/bash
set -x

function cleanup {
    kill -15 $BTCPID
}
trap cleanup EXIT

BTCD=copied-artifacts/src/bitcoind
DATADIR=$HOME/.bitcoin
MSCLOG=/tmp/mastercore.log

# Assume bitcoind built elsewhere and coied by Jenkins Copy Artifact plugin
chmod +x $BTCD

# Set up bitcoin conf and data dir
mkdir -p $DATADIR
cp -n bitcoin.conf $DATADIR

# setup logging
mkdir -p logs
#rm -f $MSCLOG 
touch $MSCLOG
ln -sf $MSCLOG logs/mastercore.log

# remove persistence files since 
rm -rf $DATADIR/MP_{persist,spinfo,txlist}

# Run Bitcoin on main net mode
$BTCD -server -datadir=$DATADIR -debug > logs/bitcoin.log &
BTCSTATUS=$?
BTCPID=$!

# Give server some time to start
sleep 30

# Run consensus tests
echo "Running consensus tests..."
./gradlew integrationTest --tests org.mastercoin.consensus.msc.*
GRADLESTATUS=$?

exit $GRADLESTATUS

Remove MP persistence, make symlink to log file
Remove MP persistence, make symlink to log file

* Remove MP persistence files before starting daemon
* Create symlink to log file from workspace
