2015-06-30 05:18:06 +02:00
|
|
|
#! /bin/sh -e
|
|
|
|
|
|
|
|
. `dirname $0`/vars.sh
|
|
|
|
|
|
|
|
if $CLI getinfo 2>/dev/null; then
|
|
|
|
echo $DAEMON already running >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Start clean
|
2016-03-15 07:38:42 +01:00
|
|
|
rm -rf $DATADIR
|
|
|
|
mkdir $DATADIR
|
|
|
|
|
|
|
|
# Create appropriate config file so cmdline matches.
|
|
|
|
cat > $DATADIR/bitcoin.conf <<EOF
|
|
|
|
regtest=1
|
|
|
|
testnet=0
|
|
|
|
EOF
|
2015-06-30 05:18:06 +02:00
|
|
|
|
|
|
|
$DAEMON &
|
|
|
|
i=0
|
|
|
|
while ! $CLI getinfo >/dev/null 2>&1; do
|
|
|
|
if [ $i -gt 30 ]; then
|
|
|
|
echo $DAEMON start failed? >&1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
i=$(($i + 1))
|
|
|
|
done
|
2016-04-12 06:47:45 +02:00
|
|
|
|
|
|
|
# Make sure they have segwit support!
|
2016-04-12 07:12:22 +02:00
|
|
|
if $CLI getblockchaininfo | grep -q '"witness"'; then :
|
2016-04-12 06:47:45 +02:00
|
|
|
else
|
|
|
|
echo This bitcoind does not have segwit support. >&2
|
|
|
|
echo Please install one from https://github.com/sipa/bitcoin/tree/segwit4 >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-06-30 05:18:06 +02:00
|
|
|
scripts/generate-block.sh init
|
|
|
|
|
|
|
|
A1=`scripts/get-new-address.sh`
|
2015-09-24 07:30:47 +02:00
|
|
|
TX=`$CLI sendmany "" "{ \"$A1\":0.01 }"`
|
2015-06-30 05:18:06 +02:00
|
|
|
scripts/generate-block.sh
|