rpc

package
v0.0.0-...-2c29f98 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 19 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 GetBlockResult

func GetBlockResult(client URIClient, height int64) (*ctypes.ResultBlockResults, error)

func GetBlockResultWithRetry

func GetBlockResultWithRetry(client URIClient, height int64, retryMaxAttempts int64, retryMaxWaitSeconds uint64) (*ctypes.ResultBlockResults, error)

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 URIClient

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

func (*URIClient) DoBlockResults

func (c *URIClient) DoBlockResults(ctx context.Context, height *int64) (*ctypes.ResultBlockResults, 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