mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Add an option to keep existing enclave when starting local testnet (#6065)
* Add an option to keep existing enclave when starting local testnet. * Add missing help text. * Do not add `--image-download always` flag if `-k` is present.
This commit is contained in:
@@ -12,3 +12,6 @@ network_params:
|
||||
seconds_per_slot: 3
|
||||
global_log_level: debug
|
||||
snooper_enabled: false
|
||||
additional_services:
|
||||
- dora
|
||||
- prometheus_grafana
|
||||
@@ -11,15 +11,17 @@ NETWORK_PARAMS_FILE=$SCRIPT_DIR/network_params.yaml
|
||||
BUILD_IMAGE=true
|
||||
BUILDER_PROPOSALS=false
|
||||
CI=false
|
||||
KEEP_ENCLAVE=false
|
||||
|
||||
# Get options
|
||||
while getopts "e:b:n:phc" flag; do
|
||||
while getopts "e:b:n:phck" flag; do
|
||||
case "${flag}" in
|
||||
e) ENCLAVE_NAME=${OPTARG};;
|
||||
b) BUILD_IMAGE=${OPTARG};;
|
||||
n) NETWORK_PARAMS_FILE=${OPTARG};;
|
||||
p) BUILDER_PROPOSALS=true;;
|
||||
c) CI=true;;
|
||||
k) KEEP_ENCLAVE=true;;
|
||||
h)
|
||||
echo "Start a local testnet with kurtosis."
|
||||
echo
|
||||
@@ -31,6 +33,7 @@ while getopts "e:b:n:phc" flag; do
|
||||
echo " -n: kurtosis network params file path default: $NETWORK_PARAMS_FILE"
|
||||
echo " -p: enable builder proposals"
|
||||
echo " -c: CI mode, run without other additional services like Grafana and Dora explorer"
|
||||
echo " -k: keeping enclave to allow starting the testnet without destroying the existing one"
|
||||
echo " -h: this help"
|
||||
exit
|
||||
;;
|
||||
@@ -62,9 +65,6 @@ if [ "$CI" = true ]; then
|
||||
# TODO: run assertoor tests
|
||||
yq eval '.additional_services = []' -i $NETWORK_PARAMS_FILE
|
||||
echo "Running without additional services (CI mode)."
|
||||
else
|
||||
yq eval '.additional_services = ["dora", "prometheus_grafana"]' -i $NETWORK_PARAMS_FILE
|
||||
echo "Additional services dora and prometheus_grafana added to network_params.yaml"
|
||||
fi
|
||||
|
||||
if [ "$BUILD_IMAGE" = true ]; then
|
||||
@@ -75,9 +75,14 @@ else
|
||||
echo "Not rebuilding Lighthouse Docker image."
|
||||
fi
|
||||
|
||||
# Stop local testnet
|
||||
kurtosis enclave rm -f $ENCLAVE_NAME 2>/dev/null || true
|
||||
IMAGE_DOWNLOAD_FLAG=""
|
||||
|
||||
kurtosis run --enclave $ENCLAVE_NAME github.com/ethpandaops/ethereum-package --args-file $NETWORK_PARAMS_FILE
|
||||
if [ "$KEEP_ENCLAVE" = false ]; then
|
||||
# Stop local testnet
|
||||
kurtosis enclave rm -f $ENCLAVE_NAME 2>/dev/null || true
|
||||
IMAGE_DOWNLOAD_FLAG="--image-download always"
|
||||
fi
|
||||
|
||||
kurtosis run --enclave $ENCLAVE_NAME github.com/ethpandaops/ethereum-package $IMAGE_DOWNLOAD_FLAG --args-file $NETWORK_PARAMS_FILE
|
||||
|
||||
echo "Started!"
|
||||
|
||||
Reference in New Issue
Block a user