github.com/cosmos/cosmos-sdk@v0.50.10/client/grpc/cmtservice/autocli.go (about) 1 package cmtservice 2 3 import ( 4 autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" 5 cmtv1beta1 "cosmossdk.io/api/cosmos/base/tendermint/v1beta1" 6 ) 7 8 var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ 9 Service: cmtv1beta1.Service_ServiceDesc.ServiceName, 10 RpcCommandOptions: []*autocliv1.RpcCommandOptions{ 11 { 12 RpcMethod: "GetNodeInfo", 13 Use: "node-info", 14 Short: "Query the current node info", 15 }, 16 { 17 RpcMethod: "GetSyncing", 18 Use: "syncing", 19 Short: "Query node syncing status", 20 }, 21 { 22 RpcMethod: "GetLatestBlock", 23 Use: "block-latest", 24 Short: "Query for the latest committed block", 25 }, 26 { 27 RpcMethod: "GetBlockByHeight", 28 Use: "block-by-height [height]", 29 Short: "Query for a committed block by height", 30 Long: "Query for a specific committed block using the CometBFT RPC `block_by_height` method", 31 PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, 32 }, 33 { 34 RpcMethod: "GetLatestValidatorSet", 35 Use: "validator-set", 36 Alias: []string{"validator-set-latest", "comet-validator-set", "cometbft-validator-set", "tendermint-validator-set"}, 37 Short: "Query for the latest validator set", 38 }, 39 { 40 RpcMethod: "GetValidatorSetByHeight", 41 Use: "validator-set-by-height [height]", 42 Short: "Query for a validator set by height", 43 PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, 44 }, 45 { 46 RpcMethod: "ABCIQuery", 47 Skip: true, 48 }, 49 }, 50 } 51 52 // NewCometBFTCommands is a fake `appmodule.Module` to be considered as a module 53 // and be added in AutoCLI. 54 func NewCometBFTCommands() *cometModule { //nolint:revive // fake module and limiting import of core 55 return &cometModule{} 56 } 57 58 type cometModule struct{} 59 60 func (m cometModule) IsOnePerModuleType() {} 61 func (m cometModule) IsAppModule() {} 62 63 func (m cometModule) Name() string { 64 return "comet" 65 } 66 67 func (m cometModule) AutoCLIOptions() *autocliv1.ModuleOptions { 68 return &autocliv1.ModuleOptions{ 69 Query: CometBFTAutoCLIDescriptor, 70 } 71 }