nimbus-era-files: check for gaps in ERA files

If we check only for existing files we will not notice missing files.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-10-23 11:19:33 +02:00
parent 068e367e4f
commit 42774ce4a6
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 10 additions and 2 deletions

View File

@ -1,9 +1,17 @@
#!/usr/bin/env bash
# vim: ft=bash
set -e
for ERA_FILE in {{ nimbus_era_files_timer_path }}/*; do
ERA_PATH='{{ nimbus_era_files_timer_path }}'
LAST_ERA_INDEX=$(ls "${ERA_PATH}" | awk -F- 'END{print $2}')
EXIT_CODE=0
for ERA_INDEX in $(seq -w 00001 "${LAST_ERA_INDEX}"); do
ERA_FILE=$(echo ${ERA_PATH}/mainnet-${ERA_INDEX}-*.era)
echo "Checking: ${ERA_FILE}"
{{ nimbus_era_files_nclidb_path }} \
--network={{ nimbus_era_files_network }} \
verifyEra --eraFile="${ERA_FILE}"
verifyEra --eraFile="${ERA_FILE}" || EXIT_CODE=1
done
exit "${EXIT_CODE}"