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`.
This commit is contained in:
Akihito Nakano
2025-06-08 12:21:41 +09:00
committed by GitHub
parent b2e8b67e34
commit 170cd0f587

View File

@@ -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