eth-stack/stack-orchestrator/config/eth/run-cl.sh

50 lines
1.3 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e
set -o pipefail
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
echo "Using the following env:"
echo "CERC_NETWORK: ${CERC_NETWORK}"
echo "CERC_CHECKPOINT_SYNC_URL: ${CERC_CHECKPOINT_SYNC_URL}"
echo "CERC_DEBUG_LEVEL: ${CERC_DEBUG_LEVEL}"
echo "LIGHTHOUSE_DATADIR: ${LIGHTHOUSE_DATADIR}"
echo "ETH_ENDPOINT: ${ETH_ENDPOINT}"
echo "EXECUTION_ENDPOINT: ${EXECUTION_ENDPOINT}"
# See https://linuxconfig.org/how-to-propagate-a-signal-to-child-processes-from-a-bash-script
cleanup() {
echo "Signal received, cleaning up..."
kill $(jobs -p)
wait
echo "Done"
}
trap 'cleanup' SIGINT SIGTERM
# Create a JWT secret at shared path if not found
jwtsecret_file_path=/root/secrets/jwtsecret
if [ ! -f "$jwtsecret_file_path" ]; then
openssl rand -hex 32 | tr -d "\n" > $jwtsecret_file_path
echo "Generated JWT secret at $jwtsecret_file_path"
fi
http_port=8001
lighthouse bn \
--network $CERC_NETWORK \
--datadir $LIGHTHOUSE_DATADIR/$CERC_NETWORK \
--execution-endpoint $EXECUTION_ENDPOINT \
--execution-jwt $jwtsecret_file_path \
--checkpoint-sync-url $CERC_CHECKPOINT_SYNC_URL \
--disable-deposit-contract-sync \
--debug-level $CERC_DEBUG_LEVEL \
--http \
--http-address 0.0.0.0 \
--http-port $http_port \
2>&1 | tee /var/log/lighthouse_bn.log &
beacon_pid=$!
wait $beacon_pid