Skip to content

Commit 35c79b1

Browse files
authored
fix: revert status and query blocks commands (#3470) (#3480)
* revert status command * generate * add query blocks cmds * generate
1 parent 290478e commit 35c79b1

File tree

2 files changed

+175
-0
lines changed

2 files changed

+175
-0
lines changed

Diff for: cmd/zetacored/root.go

+4
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig types.EncodingConfig) {
208208

209209
// add keybase, auxiliary RPC, query, and tx child commands
210210
rootCmd.AddCommand(
211+
server.StatusCommand(),
211212
queryCommand(),
212213
txCommand(),
213214
docsCommand(),
@@ -238,6 +239,9 @@ func queryCommand() *cobra.Command {
238239
rpc.ValidatorCommand(),
239240
authcmd.QueryTxsByEventsCmd(),
240241
authcmd.QueryTxCmd(),
242+
server.QueryBlockCmd(),
243+
server.QueryBlocksCmd(),
244+
server.QueryBlockResultsCmd(),
241245
)
242246

243247
cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID")

Diff for: docs/cli/zetacored/cli.md

+171
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Zetacore Daemon (server)
3535
* [zetacored rollback](#zetacored-rollback) - rollback Cosmos SDK and CometBFT state by one height
3636
* [zetacored snapshots](#zetacored-snapshots) - Manage local snapshots
3737
* [zetacored start](#zetacored-start) - Run the full node
38+
* [zetacored status](#zetacored-status) - Query remote node for status
3839
* [zetacored tendermint](#zetacored-tendermint) - Tendermint subcommands
3940
* [zetacored testnet](#zetacored-testnet) - subcommands for starting or configuring local testnets
4041
* [zetacored tx](#zetacored-tx) - Transactions subcommands
@@ -1671,6 +1672,9 @@ zetacored query [flags]
16711672
* [zetacored query authority](#zetacored-query-authority) - Querying commands for the authority module
16721673
* [zetacored query authz](#zetacored-query-authz) - Querying commands for the authz module
16731674
* [zetacored query bank](#zetacored-query-bank) - Querying commands for the bank module
1675+
* [zetacored query block](#zetacored-query-block) - Query for a committed block by height, hash, or event(s)
1676+
* [zetacored query block-results](#zetacored-query-block-results) - Query for a committed block's results by height
1677+
* [zetacored query blocks](#zetacored-query-blocks) - Query for paginated blocks that match a set of events
16741678
* [zetacored query comet-validator-set](#zetacored-query-comet-validator-set) - Get the full CometBFT validator set at given height
16751679
* [zetacored query consensus](#zetacored-query-consensus) - Querying commands for the consensus module
16761680
* [zetacored query crosschain](#zetacored-query-crosschain) - Querying commands for the crosschain module
@@ -2981,6 +2985,143 @@ zetacored query bank total-supply-of [denom] [flags]
29812985

29822986
* [zetacored query bank](#zetacored-query-bank) - Querying commands for the bank module
29832987

2988+
## zetacored query block
2989+
2990+
Query for a committed block by height, hash, or event(s)
2991+
2992+
### Synopsis
2993+
2994+
Query for a specific committed block using the CometBFT RPC `block` and `block_by_hash` method
2995+
2996+
```
2997+
zetacored query block --type=[height|hash] [height|hash] [flags]
2998+
```
2999+
3000+
### Examples
3001+
3002+
```
3003+
$ zetacored query block --type=height [height]
3004+
$ zetacored query block --type=hash [hash]
3005+
```
3006+
3007+
### Options
3008+
3009+
```
3010+
--grpc-addr string the gRPC endpoint to use for this chain
3011+
--grpc-insecure allow gRPC over insecure channels, if not the server must use TLS
3012+
--height int Use a specific height to query state at (this can error if the node is pruning state)
3013+
-h, --help help for block
3014+
--node string [host]:[port] to CometBFT RPC interface for this chain
3015+
-o, --output string Output format (text|json)
3016+
--type string The type to be used when querying tx, can be one of "height", "hash"
3017+
```
3018+
3019+
### Options inherited from parent commands
3020+
3021+
```
3022+
--chain-id string The network chain ID
3023+
--home string directory for config and data
3024+
--log_format string The logging format (json|plain)
3025+
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:[level],[key]:[level]')
3026+
--log_no_color Disable colored logs
3027+
--trace print out full stack trace on errors
3028+
```
3029+
3030+
### SEE ALSO
3031+
3032+
* [zetacored query](#zetacored-query) - Querying subcommands
3033+
3034+
## zetacored query block-results
3035+
3036+
Query for a committed block's results by height
3037+
3038+
### Synopsis
3039+
3040+
Query for a specific committed block's results using the CometBFT RPC `block_results` method
3041+
3042+
```
3043+
zetacored query block-results [height] [flags]
3044+
```
3045+
3046+
### Options
3047+
3048+
```
3049+
--grpc-addr string the gRPC endpoint to use for this chain
3050+
--grpc-insecure allow gRPC over insecure channels, if not the server must use TLS
3051+
--height int Use a specific height to query state at (this can error if the node is pruning state)
3052+
-h, --help help for block-results
3053+
--node string [host]:[port] to CometBFT RPC interface for this chain
3054+
-o, --output string Output format (text|json)
3055+
```
3056+
3057+
### Options inherited from parent commands
3058+
3059+
```
3060+
--chain-id string The network chain ID
3061+
--home string directory for config and data
3062+
--log_format string The logging format (json|plain)
3063+
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:[level],[key]:[level]')
3064+
--log_no_color Disable colored logs
3065+
--trace print out full stack trace on errors
3066+
```
3067+
3068+
### SEE ALSO
3069+
3070+
* [zetacored query](#zetacored-query) - Querying subcommands
3071+
3072+
## zetacored query blocks
3073+
3074+
Query for paginated blocks that match a set of events
3075+
3076+
### Synopsis
3077+
3078+
Search for blocks that match the exact given events where results are paginated.
3079+
The events query is directly passed to CometBFT's RPC BlockSearch method and must
3080+
conform to CometBFT's query syntax.
3081+
Please refer to each module's documentation for the full set of events to query
3082+
for. Each module documents its respective events under 'xx_events.md'.
3083+
3084+
3085+
```
3086+
zetacored query blocks [flags]
3087+
```
3088+
3089+
### Examples
3090+
3091+
```
3092+
$ zetacored query blocks --query "message.sender='cosmos1...' AND block.height > 7" --page 1 --limit 30 --order_by asc
3093+
```
3094+
3095+
### Options
3096+
3097+
```
3098+
--grpc-addr string the gRPC endpoint to use for this chain
3099+
--grpc-insecure allow gRPC over insecure channels, if not the server must use TLS
3100+
--height int Use a specific height to query state at (this can error if the node is pruning state)
3101+
-h, --help help for blocks
3102+
--limit int Query number of transactions results per page returned (default 100)
3103+
--node string [host]:[port] to CometBFT RPC interface for this chain
3104+
--order_by string The ordering semantics (asc|dsc)
3105+
-o, --output string Output format (text|json)
3106+
--page int Query a specific page of paginated results (default 1)
3107+
--query string The blocks events query per CometBFT's query semantics
3108+
```
3109+
3110+
### Options inherited from parent commands
3111+
3112+
```
3113+
--chain-id string The network chain ID
3114+
--home string directory for config and data
3115+
--log_format string The logging format (json|plain)
3116+
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:[level],[key]:[level]')
3117+
--log_no_color Disable colored logs
3118+
--trace print out full stack trace on errors
3119+
```
3120+
3121+
### SEE ALSO
3122+
3123+
* [zetacored query](#zetacored-query) - Querying subcommands
3124+
29843125
## zetacored query comet-validator-set
29853126

29863127
Get the full CometBFT validator set at given height
@@ -9021,6 +9162,36 @@ zetacored start [flags]
90219162

90229163
* [zetacored](#zetacored) - Zetacore Daemon (server)
90239164

9165+
## zetacored status
9166+
9167+
Query remote node for status
9168+
9169+
```
9170+
zetacored status [flags]
9171+
```
9172+
9173+
### Options
9174+
9175+
```
9176+
-h, --help help for status
9177+
-n, --node string Node to connect to
9178+
-o, --output string Output format (text|json)
9179+
```
9180+
9181+
### Options inherited from parent commands
9182+
9183+
```
9184+
--home string directory for config and data
9185+
--log_format string The logging format (json|plain)
9186+
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:[level],[key]:[level]')
9187+
--log_no_color Disable colored logs
9188+
--trace print out full stack trace on errors
9189+
```
9190+
9191+
### SEE ALSO
9192+
9193+
* [zetacored](#zetacored) - Zetacore Daemon (server)
9194+
90249195
## zetacored tendermint
90259196

90269197
Tendermint subcommands

0 commit comments

Comments
 (0)