Browse Source

contrib/startup_regtest.sh: avoid getting stuck in initialblockdownload.

And give a hint as to what cmds are available, since I forget!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 5 years ago
committed by Christian Decker
parent
commit
7a592a2b5c
  1. 10
      contrib/startup_regtest.sh

10
contrib/startup_regtest.sh

@ -87,12 +87,22 @@ start_ln() {
test -f "$PATH_TO_BITCOIN/regtest/bitcoind.pid" || \ test -f "$PATH_TO_BITCOIN/regtest/bitcoind.pid" || \
bitcoind -daemon -regtest -txindex bitcoind -daemon -regtest -txindex
# Wait for it to start.
while ! bt-cli ping 2> /dev/null; do sleep 1; done
# Kick it out of initialblockdownload if necessary
if bt-cli getblockchaininfo | grep -q 'initialblockdownload.*true'; then
bt-cli generatetoaddress 1 "$(bt-cli getnewaddress)" > /dev/null
fi
# Start the lightning nodes # Start the lightning nodes
test -f /tmp/l1-regtest/lightningd-regtest.pid || \ test -f /tmp/l1-regtest/lightningd-regtest.pid || \
"$LIGHTNINGD" --lightning-dir=/tmp/l1-regtest "$LIGHTNINGD" --lightning-dir=/tmp/l1-regtest
test -f /tmp/l2-regtest/lightningd-regtest.pid || \ test -f /tmp/l2-regtest/lightningd-regtest.pid || \
"$LIGHTNINGD" --lightning-dir=/tmp/l2-regtest "$LIGHTNINGD" --lightning-dir=/tmp/l2-regtest
# Give a hint.
echo "Commands: l1-cli, l2-cli, bt-cli, stop_ln, cleanup_ln"
} }
stop_ln() { stop_ln() {

Loading…
Cancel
Save