Make run-sanity.sh ledger-tool verify operate on more slots (#25591)

Prior to this change, genesis.tar.bz2 and the snapshot would be copied
over to a new directory but not rocksdb. As such, the verify step would
only unpack the snapshot and verify that hash.
This commit is contained in:
steviez 2022-05-26 15:44:09 -05:00 committed by GitHub
parent 7f4128947b
commit 7d202a0be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -22,11 +22,13 @@ while [[ ! -f config/run/init-completed ]]; do
done
snapshot_slot=1
latest_slot=0
# wait a bit longer than snapshot_slot
while [[ $($solana_cli --url http://localhost:8899 slot --commitment processed) -le $((snapshot_slot + 1)) ]]; do
while [[ $latest_slot -le $((snapshot_slot + 1)) ]]; do
sleep 1
echo "Checking slot"
latest_slot=$($solana_cli --url http://localhost:8899 slot --commitment processed)
done
$solana_validator --ledger config/ledger exit --force || true
@ -35,4 +37,6 @@ wait $pid
$solana_ledger_tool create-snapshot --ledger config/ledger "$snapshot_slot" config/snapshot-ledger
cp config/ledger/genesis.tar.bz2 config/snapshot-ledger
$solana_ledger_tool copy --ledger config/ledger \
--target-db config/snapshot-ledger --starting-slot "$snapshot_slot" --ending-slot "$latest_slot"
$solana_ledger_tool verify --ledger config/snapshot-ledger