From 170cd0f5875daa61e3521d61a903f562e5f0bc13 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 8 Jun 2025 12:21:41 +0900 Subject: [PATCH] Store the libp2p/discv5 logs when stopping local-testnet (#7579) The libp2p/discv5 logs are not stored when stopping local-testnet. Store the `beacon/logs` directory to [Kurtosis Files Artifacts](https://docs.kurtosis.com/advanced-concepts/files-artifacts/) so that they are downloaded locally by `kurtosis enclave dump`. --- scripts/local_testnet/stop_local_testnet.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/local_testnet/stop_local_testnet.sh b/scripts/local_testnet/stop_local_testnet.sh index 6af1989e9f..b90a891154 100755 --- a/scripts/local_testnet/stop_local_testnet.sh +++ b/scripts/local_testnet/stop_local_testnet.sh @@ -6,10 +6,21 @@ ENCLAVE_NAME=${1:-local-testnet} LOGS_PATH=$SCRIPT_DIR/logs LOGS_SUBDIR=$LOGS_PATH/$ENCLAVE_NAME +# Extract the service names of Lighthouse beacon nodes that start with "cl-". +services=$(kurtosis enclave inspect "$ENCLAVE_NAME" | awk '/^=+ User Services =+$/ { in_section=1; next } + /^=+/ { in_section=0 } + in_section && /^[0-9a-f]{12}/ { print $2 }' | grep '^cl-') + +# Store logs (including dependency logs) to Kurtosis Files Artifacts. These are downloaded locally by `kurtosis enclave dump`. +for service in $services; do + kurtosis files storeservice --name "$service-logs" "$ENCLAVE_NAME" "$service" /data/lighthouse/beacon-data/beacon/logs/ +done + # Delete existing logs directory and make sure parent directory exists. rm -rf $LOGS_SUBDIR && mkdir -p $LOGS_PATH kurtosis enclave dump $ENCLAVE_NAME $LOGS_SUBDIR echo "Local testnet logs stored to $LOGS_SUBDIR." +echo "The lighthouse beacon nodes' logs (including dependency logs) can be found in $LOGS_SUBDIR/files/cl-*-lighthouse-geth-logs." kurtosis enclave rm -f $ENCLAVE_NAME kurtosis engine stop