Skip to content

Commit

Permalink
contrib/startup_regtest.sh: avoid getting stuck in initialblockdownload.
Browse files Browse the repository at this point in the history
And give a hint as to what cmds are available, since I forget!

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Aug 10, 2019
1 parent 2a09124 commit 7a592a2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contrib/startup_regtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,22 @@ start_ln() {
test -f "$PATH_TO_BITCOIN/regtest/bitcoind.pid" || \
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
test -f /tmp/l1-regtest/lightningd-regtest.pid || \
"$LIGHTNINGD" --lightning-dir=/tmp/l1-regtest
test -f /tmp/l2-regtest/lightningd-regtest.pid || \
"$LIGHTNINGD" --lightning-dir=/tmp/l2-regtest

# Give a hint.
echo "Commands: l1-cli, l2-cli, bt-cli, stop_ln, cleanup_ln"
}

stop_ln() {
Expand Down

0 comments on commit 7a592a2

Please sign in to comment.