Skip to content

Commit 170cd0f

Browse files
authored
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`.
1 parent b2e8b67 commit 170cd0f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/local_testnet/stop_local_testnet.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@ ENCLAVE_NAME=${1:-local-testnet}
66
LOGS_PATH=$SCRIPT_DIR/logs
77
LOGS_SUBDIR=$LOGS_PATH/$ENCLAVE_NAME
88

9+
# Extract the service names of Lighthouse beacon nodes that start with "cl-".
10+
services=$(kurtosis enclave inspect "$ENCLAVE_NAME" | awk '/^=+ User Services =+$/ { in_section=1; next }
11+
/^=+/ { in_section=0 }
12+
in_section && /^[0-9a-f]{12}/ { print $2 }' | grep '^cl-')
13+
14+
# Store logs (including dependency logs) to Kurtosis Files Artifacts. These are downloaded locally by `kurtosis enclave dump`.
15+
for service in $services; do
16+
kurtosis files storeservice --name "$service-logs" "$ENCLAVE_NAME" "$service" /data/lighthouse/beacon-data/beacon/logs/
17+
done
18+
919
# Delete existing logs directory and make sure parent directory exists.
1020
rm -rf $LOGS_SUBDIR && mkdir -p $LOGS_PATH
1121
kurtosis enclave dump $ENCLAVE_NAME $LOGS_SUBDIR
1222
echo "Local testnet logs stored to $LOGS_SUBDIR."
23+
echo "The lighthouse beacon nodes' logs (including dependency logs) can be found in $LOGS_SUBDIR/files/cl-*-lighthouse-geth-logs."
1324

1425
kurtosis enclave rm -f $ENCLAVE_NAME
1526
kurtosis engine stop

0 commit comments

Comments
 (0)