client

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

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConsensusStateNotAvailable is returned because Dymint doesn't use Tendermint consensus.
	ErrConsensusStateNotAvailable = errors.New("consensus state not available in Dymint")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*types.EventBus
	// contains filtered or unexported fields
}

Client implements tendermint RPC client interface.

This is the type that is used in communication between cosmos-sdk app and Dymint.

func NewClient

func NewClient(node *node.Node) *Client

NewClient returns Client working with given node.

func (*Client) ABCIInfo

func (c *Client) ABCIInfo(ctx context.Context) (*ctypes.ResultABCIInfo, error)

ABCIInfo returns basic information about application state.

func (*Client) ABCIQuery

func (c *Client) ABCIQuery(ctx context.Context, path string, data tmbytes.HexBytes) (*ctypes.ResultABCIQuery, error)

ABCIQuery queries for data from application.

func (*Client) ABCIQueryWithOptions

func (c *Client) ABCIQueryWithOptions(ctx context.Context, path string, data tmbytes.HexBytes, opts rpcclient.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)

ABCIQueryWithOptions queries for data from application.

func (*Client) Block

func (c *Client) Block(ctx context.Context, height *int64) (*ctypes.ResultBlock, error)

Block method returns BlockID and block itself for given height.

If height is nil, it returns information about last known block.

func (*Client) BlockByHash

func (c *Client) BlockByHash(ctx context.Context, hash []byte) (*ctypes.ResultBlock, error)

BlockByHash returns BlockID and block itself for given hash.

func (*Client) BlockResults

func (c *Client) BlockResults(ctx context.Context, height *int64) (*ctypes.ResultBlockResults, error)

BlockResults returns information about transactions, events and updates of validator set and consensus params.

func (*Client) BlockSearch

func (c *Client) BlockSearch(ctx context.Context, query string, page, perPage *int, orderBy string) (*ctypes.ResultBlockSearch, error)

BlockSearch defines a method to search for a paginated set of blocks by BeginBlock and EndBlock event search criteria.

func (*Client) BlockchainInfo

func (c *Client) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)

BlockchainInfo returns ABCI block meta information for given height range.

func (*Client) BroadcastEvidence

func (c *Client) BroadcastEvidence(ctx context.Context, evidence types.Evidence) (*ctypes.ResultBroadcastEvidence, error)

BroadcastEvidence is not yet implemented.

func (*Client) BroadcastTxAsync

func (c *Client) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error)

BroadcastTxAsync returns right away, with no response. Does not wait for CheckTx nor DeliverTx results. More: https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_async

func (*Client) BroadcastTxCommit

func (c *Client) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error)

BroadcastTxCommit returns with the responses from CheckTx and DeliverTx. More: https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_commit

func (*Client) BroadcastTxSync

func (c *Client) BroadcastTxSync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error)

BroadcastTxSync returns with the response from CheckTx. Does not wait for DeliverTx result. More: https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_sync

func (*Client) CheckTx

func (c *Client) CheckTx(ctx context.Context, tx types.Tx) (*ctypes.ResultCheckTx, error)

CheckTx executes a new transaction against the application to determine its validity.

If valid, the tx is automatically added to the mempool.

func (*Client) Commit

func (c *Client) Commit(ctx context.Context, height *int64) (*ctypes.ResultCommit, error)

Commit returns signed header (aka commit) at given height.

func (*Client) ConsensusParams

func (c *Client) ConsensusParams(ctx context.Context, height *int64) (*ctypes.ResultConsensusParams, error)

ConsensusParams returns consensus params at given height.

Currently, consensus params changes are not supported and this method returns params as defined in genesis.

func (*Client) ConsensusState

func (c *Client) ConsensusState(ctx context.Context) (*ctypes.ResultConsensusState, error)

ConsensusState always returns error as there is no consensus state in Dymint.

func (*Client) DumpConsensusState

func (c *Client) DumpConsensusState(ctx context.Context) (*ctypes.ResultDumpConsensusState, error)

DumpConsensusState always returns error as there is no consensus state in Dymint.

func (*Client) Genesis

func (c *Client) Genesis(_ context.Context) (*ctypes.ResultGenesis, error)

Genesis returns entire genesis.

func (*Client) GenesisChunked

func (c *Client) GenesisChunked(context context.Context, id uint) (*ctypes.ResultGenesisChunk, error)

GenesisChunked returns given chunk of genesis.

func (*Client) Health

func (c *Client) Health(ctx context.Context) (*ctypes.ResultHealth, error)

Health endpoint returns empty value. It can be used to monitor service availability.

func (*Client) IsSubscriptionAllowed

func (c *Client) IsSubscriptionAllowed(subscriber string) error

func (*Client) NetInfo

func (c *Client) NetInfo(ctx context.Context) (*ctypes.ResultNetInfo, error)

NetInfo returns basic information about client P2P connections.

func (*Client) NumUnconfirmedTxs

func (c *Client) NumUnconfirmedTxs(ctx context.Context) (*ctypes.ResultUnconfirmedTxs, error)

NumUnconfirmedTxs returns information about transactions in mempool.

func (*Client) Status

func (c *Client) Status(ctx context.Context) (*ctypes.ResultStatus, error)

Status returns detailed information about current status of the node.

func (*Client) Subscribe

func (c *Client) Subscribe(ctx context.Context, subscriber, query string, outCapacity ...int) (out <-chan ctypes.ResultEvent, err error)

Subscribe subscribe given subscriber to a query.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context, hash []byte, prove bool) (*ctypes.ResultTx, error)

Tx returns detailed information about transaction identified by its hash.

func (*Client) TxSearch

func (c *Client) TxSearch(ctx context.Context, query string, prove bool, pagePtr, perPagePtr *int, orderBy string) (*ctypes.ResultTxSearch, error)

TxSearch returns detailed information about transactions matching query.

func (*Client) UnconfirmedTxs

func (c *Client) UnconfirmedTxs(ctx context.Context, limitPtr *int) (*ctypes.ResultUnconfirmedTxs, error)

UnconfirmedTxs returns transactions in mempool.

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(ctx context.Context, subscriber, query string) error

Unsubscribe unsubscribes given subscriber from a query.

func (*Client) Validators

func (c *Client) Validators(ctx context.Context, heightPtr *int64, pagePtr, perPagePtr *int) (*ctypes.ResultValidators, error)

Validators returns paginated list of validators at given height.

Jump to

Keyboard shortcuts

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