rpc

package
v0.0.0-...-15db94f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBackoffDurationForAttempts

func GetBackoffDurationForAttempts(numAttempts int64, maxRetryTime time.Duration) (time.Duration, bool)

func GetBlock

func GetBlock(cl *probeClient.ChainClient, height int64) (*coretypes.ResultBlock, error)

GetBlockTimestamp

func GetEarliestAndLatestBlockHeights

func GetEarliestAndLatestBlockHeights(cl *probeClient.ChainClient) (int64, int64, error)

func GetLatestBlockHeight

func GetLatestBlockHeight(cl *probeClient.ChainClient) (int64, error)

func GetLatestBlockHeightWithRetry

func GetLatestBlockHeightWithRetry(cl *probeClient.ChainClient, retryMaxAttempts int64, retryMaxWaitSeconds uint64) (int64, error)

func GetTxsByBlockHeight

func GetTxsByBlockHeight(cl *probeClient.ChainClient, height int64) (*txTypes.GetTxsEventResponse, error)

GetTxsByBlockHeight makes a request to the Cosmos RPC API and returns all the transactions for a specific block

func IsCatchingUp

func IsCatchingUp(cl *probeClient.ChainClient) (bool, error)

IsCatchingUp true if the node is catching up to the chain, false otherwise

Types

type CustomBlockResults

type CustomBlockResults struct {
	Height                int64                     `json:"height"`
	TxsResults            []*abci.ResponseDeliverTx `json:"txs_results"`
	BeginBlockEvents      []abci.Event              `json:"begin_block_events"`
	EndBlockEvents        []abci.Event              `json:"end_block_events"`
	ValidatorUpdates      []abci.ValidatorUpdate    `json:"validator_updates"`
	ConsensusParamUpdates *cmtproto.ConsensusParams `json:"consensus_param_updates"`
	FinalizeBlockEvents   []abci.Event              `json:"finalize_block_events"`
}

This type **should** cover SDK v0.4x and v0.50, but updates will need to be monitored

func GetBlockResult

func GetBlockResult(client URIClient, height int64) (*CustomBlockResults, error)

func GetBlockResultWithRetry

func GetBlockResultWithRetry(client URIClient, height int64, retryMaxAttempts int64, retryMaxWaitSeconds uint64) (*CustomBlockResults, error)

type URIClient

type URIClient struct {
	Address    string
	Client     *http.Client
	AuthHeader string
}

func (*URIClient) DoBlockResults

func (c *URIClient) DoBlockResults(ctx context.Context, height *int64) (*CustomBlockResults, error)

func (*URIClient) DoHTTPGet

func (c *URIClient) DoHTTPGet(ctx context.Context, method string, params map[string]interface{}, result interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL