Documentation ¶
Index ¶
- func GetBlockByHash(clientCtx client.Context, hashHexString string) (*cmt.Block, error)
- func GetBlockByHeight(clientCtx client.Context, height *int64) (*cmt.Block, error)
- func GetChainHeight(clientCtx client.Context) (int64, error)
- func QueryBlocks(clientCtx client.Context, page, limit int, query, orderBy string) (*sdk.SearchBlocksResult, error)
- func StatusCommand() *cobra.Command
- func ValidatorCommand() *cobra.Command
- type ResultValidatorsOutput
- type ValidatorOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlockByHash ¶ added in v0.50.0
func GetBlockByHeight ¶ added in v0.50.0
get block by height
func GetChainHeight ¶
GetChainHeight returns the current blockchain height.
func QueryBlocks ¶ added in v0.50.0
func QueryBlocks(clientCtx client.Context, page, limit int, query, orderBy string) (*sdk.SearchBlocksResult, error)
Examples: tm.event = 'NewBlock' # new blocks tm.event = 'CompleteProposal' # node got a complete proposal tm.event = 'Tx' AND tx.hash = 'XYZ' # single transaction tm.event = 'Tx' AND tx.height = 5 # all txs of the fifth block tx.height = 5 # all txs of the fifth block
For more information, see the /subscribe CometBFT RPC endpoint documentation
func StatusCommand ¶
StatusCommand returns the command to return the status of the network.
func ValidatorCommand ¶
ValidatorCommand returns the validator set for a given height
Types ¶
type ResultValidatorsOutput ¶
type ResultValidatorsOutput struct { BlockHeight int64 `json:"block_height"` Validators []ValidatorOutput `json:"validators"` Total uint64 `json:"total"` }
Validators at a certain height output in bech32 format
func GetValidators ¶
func GetValidators(ctx context.Context, clientCtx client.Context, height *int64, page, limit *int) (ResultValidatorsOutput, error)
GetValidators from client
func (ResultValidatorsOutput) String ¶
func (rvo ResultValidatorsOutput) String() string
type ValidatorOutput ¶
type ValidatorOutput struct { Address sdk.ConsAddress `json:"address"` PubKey cryptotypes.PubKey `json:"pub_key"` ProposerPriority int64 `json:"proposer_priority"` VotingPower int64 `json:"voting_power"` }
Validator output
Click to show internal directories.
Click to hide internal directories.