contrib/startup_regtest: set grpc-port so we can start more than one.

A side-effect of having grpc start by default.  Annoyingly, if it
can't bind it simply exits, with no message, so I had to guess what
was happening.

Reported-by: @daywalker90
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-11-28 16:24:55 +10:30
parent a3a33fe3be
commit 39fbced71e

View file

@ -72,6 +72,11 @@ else
# This mirrors "type" output above.
fi
# Test for cln-gprc
if "$LIGHTNINGD" --help | grep -q grpc; then
HAVE_GRPC=1
fi
if [ -z "$LIGHTNING_DIR" ]; then
# Default is to use the /tmp directory
LIGHTNING_DIR=/tmp
@ -206,6 +211,11 @@ funder-lease-requests-only=false
echo "clnrest-port=$((3109+i))" >> "$LIGHTNING_DIR/l$i/config"
fi
# Grpc port too
if [ -n "$HAVE_GRPC" ]; then
echo "grpc-port=$((9736+i))" >> "$LIGHTNING_DIR/l$i/config"
fi
# Start the lightning nodes
test -f "$LIGHTNING_DIR/l$i/lightningd-$network.pid" || \
$EATMYDATA "$LIGHTNINGD" "--network=$network" "--lightning-dir=$LIGHTNING_DIR/l$i" "--bitcoin-datadir=$BITCOIN_DIR" "--database-upgrade=true" &