File tree Expand file tree Collapse file tree 4 files changed +19
-14
lines changed
ouroboros-consensus-cardano
src/unstable-cardano-tools/Cardano/Tools/DBAnalyser Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,12 @@ User should run this if they are dealing with a `cardano` chain.
9191
9292The user can limit the maximum number of blocks that db-analyser will process.
9393
94- ### Database validation
94+ ### Database validation, via --db-validation
9595
9696The tool provides two database validation policies:
9797
9898- ` validate-all-blocks ` , which will cause the tool to validate all chunks on the
99- immutable and volatile databases .
99+ immutable database .
100100- ` minimum-block-validation ` , which will cause the tool to validate only the
101101 most recent chunk in the immutable database.
102102
Original file line number Diff line number Diff line change 11{-# LANGUAGE ApplicativeDo #-}
22{-# LANGUAGE CPP #-}
3+ {-# LANGUAGE LambdaCase #-}
34
45module DBAnalyser.Parsers (
56 BlockType (.. )
@@ -55,16 +56,18 @@ parseSelectDB =
5556
5657
5758parseValidationPolicy :: Parser (Maybe ValidateBlocks )
58- parseValidationPolicy = optional $ asum [
59- flag' ValidateAllBlocks $ mconcat [
60- long " validate-all-blocks"
61- , help " Validate all blocks of the Immutable DB"
62- ]
63- , flag' MinimumBlockValidation $ mconcat [
64- long " minimum-block-validation"
65- , help " Validate a minimum part of the Immutable DB"
66- ]
67- ]
59+ parseValidationPolicy =
60+ optional $ option reader $ mconcat [
61+ long " db-validation"
62+ , help $ " The extent of the ChainDB on-disk files validation. This is "
63+ <> " completely unrelated to validation of the ledger rules. "
64+ <> " Possible values: validate-all-blocks, minimum-block-validation."
65+ ]
66+ where
67+ reader = maybeReader $ \ case
68+ " validate-all-blocks" -> Just ValidateAllBlocks
69+ " minimum-block-validation" -> Just MinimumBlockValidation
70+ _ -> Nothing
6871
6972parseAnalysis :: Parser AnalysisName
7073parseAnalysis = asum [
Original file line number Diff line number Diff line change 44
55-- | Database analysis tool.
66--
7- -- Usage: db-analyser --db PATH [--analyse-from SLOT_NUMBER]
8- -- [--validate-all-blocks | --minimum-block- validation]
7+ -- Usage: db-analyser --db PATH [--verbose] [-- analyse-from SLOT_NUMBER]
8+ -- [--db- validation ARG ]
99-- [--show-slot-block-no | --count-tx-outputs |
1010-- --show-block-header-size | --show-block-txs-size |
1111-- --show-ebbs | --store-ledger SLOT_NUMBER | --count-blocks |
Original file line number Diff line number Diff line change @@ -20,4 +20,6 @@ data DBAnalyserConfig = DBAnalyserConfig {
2020 , confLimit :: Limit
2121 }
2222
23+ -- | Whether to validate the on-disk files of the ChainDB. This is completely
24+ -- unrelated to validation of the ledger rules.
2325data ValidateBlocks = ValidateAllBlocks | MinimumBlockValidation
You can’t perform that action at this time.
0 commit comments