rpc

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	service.BaseService
	// contains filtered or unexported fields
}

Client is an RPC client, which uses lite#Client to verify data (if it can be proved!).

func NewClient

func NewClient(next rpcclient.Client, lc *lite.Client) *Client

NewClient returns a new client.

func (*Client) ABCIInfo

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

func (*Client) ABCIQuery

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

func (*Client) ABCIQueryWithOptions

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

GetWithProofOptions is useful if you want full access to the ABCIQueryOptions. XXX Usage of path? It's not used, and sometimes it's /, sometimes /key, sometimes /store.

func (*Client) Block

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

Block calls rpcclient#Block and then verifies the result.

func (*Client) BlockResults

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

func (*Client) BlockchainInfo

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

BlockchainInfo calls rpcclient#BlockchainInfo and then verifies every header returned.

func (*Client) BroadcastEvidence

func (c *Client) BroadcastEvidence(ev types.Evidence) (*ctypes.ResultBroadcastEvidence, error)

func (*Client) BroadcastTxAsync

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

func (*Client) BroadcastTxCommit

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

func (*Client) BroadcastTxSync

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

func (*Client) Commit

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

func (*Client) ConsensusParams

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

func (*Client) ConsensusReactorStatus

func (c *Client) ConsensusReactorStatus() (*ctypes.ResultConsensusReactorStatus, error)

func (*Client) ConsensusState

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

func (*Client) DumpConsensusState

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

func (*Client) Genesis

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

func (*Client) Health

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

func (*Client) NetInfo

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

func (*Client) NumUnconfirmedTxs

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

func (*Client) OnStart

func (c *Client) OnStart() error

func (*Client) OnStop

func (c *Client) OnStop()

func (*Client) RegisterOpDecoder

func (c *Client) RegisterOpDecoder(typ string, dec merkle.OpDecoder)

func (*Client) Status

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

func (*Client) Subscribe

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

func (*Client) SubscribeWS

func (c *Client) SubscribeWS(ctx *rpctypes.Context, query string) (*ctypes.ResultSubscribe, error)

SubscribeWS subscribes for events using the given query and remote address as a subscriber, but does not verify responses (UNSAFE)! TODO: verify data

func (*Client) Tx

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

Tx calls rpcclient#Tx method and then verifies the proof if such was requested.

func (*Client) TxSearch

func (c *Client) TxSearch(query string, prove bool, page, perPage int, orderBy string) (
	*ctypes.ResultTxSearch, error)

func (*Client) UnconfirmedTxs

func (c *Client) UnconfirmedTxs(limit int) (*ctypes.ResultUnconfirmedTxs, error)

func (*Client) Unsubscribe

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

func (*Client) UnsubscribeAll

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

func (*Client) UnsubscribeAllWS

func (c *Client) UnsubscribeAllWS(ctx *rpctypes.Context) (*ctypes.ResultUnsubscribe, error)

UnsubscribeAllWS calls original client's UnsubscribeAll using remote address as a subscriber.

func (*Client) UnsubscribeWS

func (c *Client) UnsubscribeWS(ctx *rpctypes.Context, query string) (*ctypes.ResultUnsubscribe, error)

UnsubscribeWS calls original client's Unsubscribe using remote address as a subscriber.

func (*Client) Validators

func (c *Client) Validators(height *int64, page, perPage int) (*ctypes.ResultValidators, error)

Validators fetches and verifies validators.

WARNING: only full validator sets are verified (when length of validators is less than +perPage+. +perPage+ default is 30, max is 100).

Jump to

Keyboard shortcuts

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