cclient

package
v2.0.0-...-4b0aec6 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABCIQueryResponse

type ABCIQueryResponse struct {
	Code  uint32 `json:"code,omitempty"`
	Value []byte `json:"value,omitempty"`
}

func (ABCIQueryResponse) ValueCleaned

func (q ABCIQueryResponse) ValueCleaned() string

The response value contains the data link escape control character which must be removed before parsing.

type BlockResults

type BlockResults struct {
	FinalizeBlockEvents []abci.Event         `json:"finalize_block_events"`
	TxsResults          []*abci.ExecTxResult `json:"txs_results"`
}

type CometRPCClient

type CometRPCClient struct {
	// contains filtered or unexported fields
}

CometRPCClient wraps our slimmed down CometBFT client and converts the returned types to the upstream CometBFT types. This is useful so that it can be used in any function calls that expect the upstream types.

func NewCometRPCClient

func NewCometRPCClient(c *client.Client) CometRPCClient

func (CometRPCClient) ABCIInfo

func (CometRPCClient) ABCIQuery

func (r CometRPCClient) ABCIQuery(
	ctx context.Context,
	path string,
	data bytes.HexBytes,
) (*coretypes.ResultABCIQuery, error)

func (CometRPCClient) ABCIQueryWithOptions

func (r CometRPCClient) ABCIQueryWithOptions(
	ctx context.Context,
	path string,
	data bytes.HexBytes,
	opts rpcclient.ABCIQueryOptions,
) (*coretypes.ResultABCIQuery, error)

func (CometRPCClient) Block

func (r CometRPCClient) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)

func (CometRPCClient) BlockByHash

func (r CometRPCClient) BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error)

func (CometRPCClient) BlockResults

func (r CometRPCClient) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error)

func (CometRPCClient) BlockSearch

func (r CometRPCClient) BlockSearch(
	ctx context.Context,
	query string,
	page, perPage *int,
	orderBy string,
) (*coretypes.ResultBlockSearch, error)

func (CometRPCClient) BlockchainInfo

func (r CometRPCClient) BlockchainInfo(
	ctx context.Context,
	minHeight, maxHeight int64,
) (*coretypes.ResultBlockchainInfo, error)

func (CometRPCClient) BroadcastTxAsync

func (r CometRPCClient) BroadcastTxAsync(ctx context.Context, tx tmtypes.Tx) (*coretypes.ResultBroadcastTx, error)

func (CometRPCClient) BroadcastTxCommit

func (CometRPCClient) BroadcastTxSync

func (r CometRPCClient) BroadcastTxSync(ctx context.Context, tx tmtypes.Tx) (*coretypes.ResultBroadcastTx, error)

func (CometRPCClient) Commit

func (r CometRPCClient) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error)

func (CometRPCClient) DoBroadcastTxAsync

func (r CometRPCClient) DoBroadcastTxAsync(ctx context.Context, tx tmtypes.Tx) (*ResultBroadcastTx, error)

DoBroadcastTxAsync implements ConsensusClient.

func (CometRPCClient) DoBroadcastTxSync

func (r CometRPCClient) DoBroadcastTxSync(ctx context.Context, tx tmtypes.Tx) (*ResultBroadcastTx, error)

DoBroadcastTxSync implements ConsensusClient.

func (CometRPCClient) GetABCIQuery

func (r CometRPCClient) GetABCIQuery(ctx context.Context, queryPath string, data bytes.HexBytes) (*ABCIQueryResponse, error)

GetABCIQuery implements ConsensusClient.

func (CometRPCClient) GetABCIQueryWithOptions

func (r CometRPCClient) GetABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts rpcclient.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)

GetABCIQueryWithOptions implements ConsensusClient.

func (CometRPCClient) GetBlockResults

func (r CometRPCClient) GetBlockResults(ctx context.Context, height uint64) (*BlockResults, error)

GetBlockResults implements ConsensusClient.

func (CometRPCClient) GetBlockSearch

func (r CometRPCClient) GetBlockSearch(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error)

GetBlockSearch implements ConsensusClient.

func (CometRPCClient) GetBlockTime

func (r CometRPCClient) GetBlockTime(ctx context.Context, height uint64) (time.Time, error)

GetBlock implements ConsensusClient.

func (CometRPCClient) GetCommit

func (r CometRPCClient) GetCommit(ctx context.Context, height uint64) (*coretypes.ResultCommit, error)

GetCommit implements ConsensusClient.

func (CometRPCClient) GetStatus

func (r CometRPCClient) GetStatus(ctx context.Context) (*Status, error)

GetStatus implements ConsensusClient.

func (CometRPCClient) GetTx

func (r CometRPCClient) GetTx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error)

GetTx implements ConsensusClient.

func (CometRPCClient) GetTxSearch

func (r CometRPCClient) GetTxSearch(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string) (*ResultTxSearch, error)

GetTxSearch implements ConsensusClient.

func (CometRPCClient) GetValidators

func (r CometRPCClient) GetValidators(ctx context.Context, height *int64, page *int, perPage *int) (*ResultValidators, error)

GetValidators implements ConsensusClient.

func (CometRPCClient) Status

func (CometRPCClient) Tx

func (r CometRPCClient) Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error)

func (CometRPCClient) TxSearch

func (r CometRPCClient) TxSearch(
	ctx context.Context,
	query string,
	prove bool,
	page, perPage *int,
	orderBy string,
) (*coretypes.ResultTxSearch, error)

func (CometRPCClient) Validators

func (r CometRPCClient) Validators(
	ctx context.Context,
	height *int64,
	page, perPage *int,
) (*coretypes.ResultValidators, error)

type ConsensusClient

type ConsensusClient interface {
	GetBlockTime(ctx context.Context, height uint64) (time.Time, error)
	GetStatus(ctx context.Context) (*Status, error)
	GetBlockResults(ctx context.Context, height uint64) (*BlockResults, error)
	GetABCIQuery(ctx context.Context, queryPath string, data bytes.HexBytes) (*ABCIQueryResponse, error)
	GetValidators(
		ctx context.Context,
		height *int64,
		page, perPage *int,
	) (*ResultValidators, error)
	GetTxSearch(
		ctx context.Context,
		query string,
		prove bool,
		page, perPage *int,
		orderBy string,
	) (*ResultTxSearch, error)
	DoBroadcastTxSync(ctx context.Context, tx tmtypes.Tx) (*ResultBroadcastTx, error)
	DoBroadcastTxAsync(ctx context.Context, tx tmtypes.Tx) (*ResultBroadcastTx, error)
	GetTx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error)
	GetBlockSearch(
		ctx context.Context,
		query string,
		page, perPage *int,
		orderBy string,
	) (*coretypes.ResultBlockSearch, error)
	GetCommit(ctx context.Context, height uint64) (*coretypes.ResultCommit, error)
	GetABCIQueryWithOptions(
		ctx context.Context,
		path string,
		data bytes.HexBytes,
		opts rpcclient.ABCIQueryOptions,
	) (*coretypes.ResultABCIQuery, error)
}

TODO(reece): get off cometbft types into internal relayer.

type ResultBroadcastTx

type ResultBroadcastTx struct {
	Code      uint32         `json:"code"`
	Data      bytes.HexBytes `json:"data"`
	Log       string         `json:"log"`
	Codespace string         `json:"codespace"`
	Hash      bytes.HexBytes `json:"hash"`
}

type ResultTxSearch

type ResultTxSearch struct {
	Txs []*coretypes.ResultTx `json:"txs"`
}

coretypes.ResultTxSearch

type ResultValidators

type ResultValidators struct {
	Validators []*tmtypes.Validator `json:"validators"`
}

type Status

type Status struct {
	CatchingUp        bool
	LatestBlockHeight uint64
}

type Validator

type Validator struct {
	Address          crypto.Address `json:"address"`
	PubKey           crypto.PubKey  `json:"pub_key"`
	VotingPower      int64          `json:"voting_power"`
	ProposerPriority int64          `json:"proposer_priority"`
}

Jump to

Keyboard shortcuts

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