mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +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
|
seconds_per_slot: 3
|
||||||
global_log_level: debug
|
global_log_level: debug
|
||||||
snooper_enabled: false
|
snooper_enabled: false
|
||||||
|
additional_services:
|
||||||
|
- dora
|
||||||
|
- prometheus_grafana
|
||||||
@@ -11,15 +11,17 @@ NETWORK_PARAMS_FILE=$SCRIPT_DIR/network_params.yaml
|
|||||||
BUILD_IMAGE=true
|
BUILD_IMAGE=true
|
||||||
BUILDER_PROPOSALS=false
|
BUILDER_PROPOSALS=false
|
||||||
CI=false
|
CI=false
|
||||||
|
KEEP_ENCLAVE=false
|
||||||
|
|
||||||
# Get options
|
# Get options
|
||||||
while getopts "e:b:n:phc" flag; do
|
while getopts "e:b:n:phck" flag; do
|
||||||
case "${flag}" in
|
case "${flag}" in
|
||||||
e) ENCLAVE_NAME=${OPTARG};;
|
e) ENCLAVE_NAME=${OPTARG};;
|
||||||
b) BUILD_IMAGE=${OPTARG};;
|
b) BUILD_IMAGE=${OPTARG};;
|
||||||
n) NETWORK_PARAMS_FILE=${OPTARG};;
|
n) NETWORK_PARAMS_FILE=${OPTARG};;
|
||||||
p) BUILDER_PROPOSALS=true;;
|
p) BUILDER_PROPOSALS=true;;
|
||||||
c) CI=true;;
|
c) CI=true;;
|
||||||
|
k) KEEP_ENCLAVE=true;;
|
||||||
h)
|
h)
|
||||||
echo "Start a local testnet with kurtosis."
|
echo "Start a local testnet with kurtosis."
|
||||||
echo
|
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 " -n: kurtosis network params file path default: $NETWORK_PARAMS_FILE"
|
||||||
echo " -p: enable builder proposals"
|
echo " -p: enable builder proposals"
|
||||||
echo " -c: CI mode, run without other additional services like Grafana and Dora explorer"
|
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"
|
echo " -h: this help"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
@@ -62,9 +65,6 @@ if [ "$CI" = true ]; then
|
|||||||
# TODO: run assertoor tests
|
# TODO: run assertoor tests
|
||||||
yq eval '.additional_services = []' -i $NETWORK_PARAMS_FILE
|
yq eval '.additional_services = []' -i $NETWORK_PARAMS_FILE
|
||||||
echo "Running without additional services (CI mode)."
|
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
|
fi
|
||||||
|
|
||||||
if [ "$BUILD_IMAGE" = true ]; then
|
if [ "$BUILD_IMAGE" = true ]; then
|
||||||
@@ -75,9 +75,14 @@ else
|
|||||||
echo "Not rebuilding Lighthouse Docker image."
|
echo "Not rebuilding Lighthouse Docker image."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stop local testnet
|
IMAGE_DOWNLOAD_FLAG=""
|
||||||
kurtosis enclave rm -f $ENCLAVE_NAME 2>/dev/null || true
|
|
||||||
|
|
||||||
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!"
|
echo "Started!"
|
||||||
|
|||||||
Reference in New Issue
Block a user