Skip to content

Commit

Permalink
Show progress of --store-ledger every 1000 blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
EncodePanda committed Oct 6, 2021
1 parent a6d4fcd commit d90ade0
Showing 1 changed file with 7 additions and 4 deletions.
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 @@ -211,17 +211,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

0 comments on commit d90ade0

Please sign in to comment.