Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAD-3383] Show progress of --store-ledger every 1000 blocks #3414

Merged
merged 1 commit into from
Oct 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions ouroboros-consensus-cardano/tools/db-analyser/Analysis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,20 @@ storeLedgerStateAt slotNo (AnalysisEnv { db, registry, initLedger, cfg, limit, l
newLedger = either (error . show) lrResult $ runExcept $ appliedResult
when (blockSlot blk >= slotNo) $ storeLedgerState blk newLedger
when (blockSlot blk > slotNo) $ issueWarning blk
when ((unBlockNo $ blockNo blk) `mod` 1000 == 0) $ reportProgress blk
return (continue blk, newLedger)

continue :: blk -> NextStep
continue blk
| blockSlot blk >= slotNo = Stop
| otherwise = Continue

issueWarning blk = putStrLn $ "Snapshot was created at " <>
show (blockSlot blk) <> " " <>
"because there was no block forged at requested " <>
show slotNo <> ". "
issueWarning blk = putStrLn $ "Snapshot was created at " <>
show (blockSlot blk) <> " " <>
"because there was no block forged at requested " <>
show slotNo <> ". "
reportProgress blk = putStrLn $ "... reached slot " <>
show (blockSlot blk)

storeLedgerState ::
blk
Expand Down