-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathConfig.hs
More file actions
64 lines (60 loc) · 2.88 KB
/
Copy pathConfig.hs
File metadata and controls
64 lines (60 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module BlockStateDump.Config where
import Data.Functor.Identity
import Options.Applicative
import Concordium.Types
data Config
= DumpState
{ cTreeStateDbPath :: FilePath,
cAccountMapDbPath :: FilePath,
cBlockStatePath :: FilePath,
cOutDir :: FilePath,
cProtocolVersion :: ProtocolVersion,
cBlockHeights :: [BlockHeight]
}
config :: Parser (Identity Config)
config =
Identity
<$> ( hsubparser
( metavar "command"
<> ( command
"state"
( info
( DumpState
<$> strOption
( long "tree-state-db-path"
<> metavar "TREESTATEDBPATH"
<> help "Path to tree state LMDB database directory (e.g. xyz/database-v4/treestate-0)"
)
<*> strOption
( long "account-map-db-path"
<> metavar "ACCOUNTMAPDBPATH"
<> help "Path to account map LMDB database directory (e.g. xyz/database-v4/accountmap)"
)
<*> strOption
( long "block-state-path"
<> metavar "BLOCKSTATEPATH"
<> help "Path to block state file (e.g. xyz/database-v4/blockstate-0.dat)"
)
<*> strOption
( long "out-dir"
<> metavar "OUTDIR"
<> help "Path to directory to output dump to"
)
<*> option
auto
( long "protocol-version"
<> metavar "PROTOCOLVERSION"
<> help "Protocol version for the tree state and block state, e.g. P9"
)
<*> option
auto
( long "block-heights"
<> metavar "BLOCKHEIGHTS"
<> help "Relative heights of block to dump state for"
)
)
(progDesc "Dump block state")
)
)
)
)