mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-10 15:45:09 +01:00
edcec2ba4e
You need to be running a bitcoind modified with segregated witness: https://github.com/sipa/bitcoin/tree/segwit4 It needs 432 blocks to activate it! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
44 lines
835 B
Bash
Executable File
44 lines
835 B
Bash
Executable File
#! /bin/sh -e
|
|
|
|
. `dirname $0`/vars.sh
|
|
|
|
if $CLI getinfo 2>/dev/null; then
|
|
echo $DAEMON already running >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Start clean
|
|
rm -rf $DATADIR
|
|
mkdir $DATADIR
|
|
|
|
# Create appropriate config file so cmdline matches.
|
|
cat > $DATADIR/bitcoin.conf <<EOF
|
|
regtest=1
|
|
testnet=0
|
|
EOF
|
|
|
|
$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
|
|
|
|
# Make sure they have segwit support!
|
|
if $CLI help createwitnessaddress > /dev/null 2>&1; then :
|
|
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
|
|
|
|
scripts/generate-block.sh init
|
|
|
|
A1=`scripts/get-new-address.sh`
|
|
TX=`$CLI sendmany "" "{ \"$A1\":0.01 }"`
|
|
scripts/generate-block.sh
|