File tree 3 files changed +26
-8
lines changed 3 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ To run the observer in Direct Mode, provide the following arguments:
13
13
For example:
14
14
15
15
``` shell
16
- hydra-chain-observer \
16
+ hydra-chain-observer direct \
17
17
--node-socket testnets/preprod/node.socket \
18
18
--testnet-magic 1 \
19
19
--start-chain-from " 41948777.5d34af0f42be9823ebd35c2d83d5d879c5615ac17f7158bb9aa4ef89072455a7"
@@ -23,15 +23,15 @@ hydra-chain-observer \
23
23
## Blockfrost Mode
24
24
25
25
To run the observer in Blockfrost Mode, provide the following arguments:
26
- - ` --project ` : file path to your Blockfrost project API token hash.
26
+ - ` --project-path ` : file path to your Blockfrost project API token hash.
27
27
> expected to be prefixed with environment (e.g. testnetA3C2E...)
28
28
- (optional) ` --start-from-block-hash ` : specify a block hash to start observing from.
29
29
30
30
For example:
31
31
32
32
``` shell
33
- hydra-chain-observer \
34
- --project project_token_hash \
33
+ hydra-chain-observer blockfrost \
34
+ --project-path project_token_hash \
35
35
--start-from-block-hash " 5d34af0f42be9823ebd35c2d83d5d879c5615ac17f7158bb9aa4ef89072455a7"
36
36
```
37
37
Original file line number Diff line number Diff line change @@ -11,10 +11,12 @@ import Hydra.Options (
11
11
import Options.Applicative (
12
12
Parser ,
13
13
ParserInfo ,
14
+ command ,
14
15
fullDesc ,
15
16
header ,
16
17
help ,
17
18
helper ,
19
+ hsubparser ,
18
20
info ,
19
21
long ,
20
22
metavar ,
@@ -55,9 +57,9 @@ blockfrostOptionsParser =
55
57
projectPathParser :: Parser FilePath
56
58
projectPathParser =
57
59
option str $
58
- long " project"
60
+ long " project-path "
59
61
<> metavar " BLOCKFROST_TOKEN_PATH"
60
- <> value " ./ "
62
+ <> value " project_token_hash "
61
63
<> help
62
64
" The path where the Blockfrost project token hash is stored.\
63
65
\It expects token prefixed with Blockfrost environment name\
@@ -73,10 +75,25 @@ startFromBlockHashParser =
73
75
\used if the last known head state is older than given point. If not \
74
76
\given and no known head state, the chain tip is used."
75
77
78
+ directOptionsInfo :: ParserInfo Options
79
+ directOptionsInfo =
80
+ info
81
+ optionsParser
82
+ (progDesc " Direct Mode" )
83
+
84
+ blockfrostOptionsInfo :: ParserInfo Options
85
+ blockfrostOptionsInfo =
86
+ info
87
+ blockfrostOptionsParser
88
+ (progDesc " Blockfrost Mode" )
89
+
76
90
hydraChainObserverOptions :: ParserInfo Options
77
91
hydraChainObserverOptions =
78
92
info
79
- ( (optionsParser <|> blockfrostOptionsParser)
93
+ ( hsubparser
94
+ ( command " direct" directOptionsInfo
95
+ <> command " blockfrost" blockfrostOptionsInfo
96
+ )
80
97
<**> helper
81
98
)
82
99
( fullDesc
Original file line number Diff line number Diff line change @@ -84,7 +84,8 @@ run opts = do
84
84
(getExplorerState, modifyExplorerState) <- createExplorerState
85
85
86
86
let chainObserverArgs =
87
- Options. toArgNodeSocket nodeSocket
87
+ [" direct" ]
88
+ <> Options. toArgNodeSocket nodeSocket
88
89
<> Options. toArgNetworkId networkId
89
90
<> toArgStartChainFrom startChainFrom
90
91
race_
You can’t perform that action at this time.
0 commit comments