Documentation ¶
Index ¶
- type Local
- func (c *Local) ABCIInfo(ctx context.Context) (*coretypes.ResultABCIInfo, error)
- func (c *Local) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error)
- func (c *Local) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, ...) (*coretypes.ResultABCIQuery, error)
- func (c *Local) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)
- func (c *Local) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultBlock, error)
- func (c *Local) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error)
- func (c *Local) BlockSearch(ctx context.Context, queryString string, page, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error)
- func (c *Local) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error)
- func (c *Local) BroadcastEvidence(ctx context.Context, ev types.Evidence) (*coretypes.ResultBroadcastEvidence, error)
- func (c *Local) BroadcastTx(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)
- func (c *Local) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)
- func (c *Local) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTxCommit, error)
- func (c *Local) BroadcastTxSync(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)
- func (c *Local) CheckTx(ctx context.Context, tx types.Tx) (*coretypes.ResultCheckTx, error)
- func (c *Local) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error)
- func (c *Local) ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error)
- func (c *Local) ConsensusState(ctx context.Context) (*coretypes.ResultConsensusState, error)
- func (c *Local) DumpConsensusState(ctx context.Context) (*coretypes.ResultDumpConsensusState, error)
- func (c *Local) Events(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error)
- func (c *Local) Genesis(ctx context.Context) (*coretypes.ResultGenesis, error)
- func (c *Local) GenesisChunked(ctx context.Context, id uint) (*coretypes.ResultGenesisChunk, error)
- func (c *Local) Header(ctx context.Context, height *int64) (*coretypes.ResultHeader, error)
- func (c *Local) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error)
- func (c *Local) Health(ctx context.Context) (*coretypes.ResultHealth, error)
- func (c *Local) NetInfo(ctx context.Context) (*coretypes.ResultNetInfo, error)
- func (c *Local) NumUnconfirmedTxs(ctx context.Context) (*coretypes.ResultUnconfirmedTxs, error)
- func (c *Local) RemoveTx(ctx context.Context, txKey types.TxKey) error
- func (c *Local) Status(ctx context.Context) (*coretypes.ResultStatus, error)
- func (c *Local) Subscribe(ctx context.Context, subscriber, queryString string, capacity ...int) (<-chan coretypes.ResultEvent, error)
- func (c *Local) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*coretypes.ResultTx, error)
- func (c *Local) TxSearch(ctx context.Context, queryString string, prove bool, page, perPage *int, ...) (*coretypes.ResultTxSearch, error)
- func (c *Local) UnconfirmedTxs(ctx context.Context, page, perPage *int) (*coretypes.ResultUnconfirmedTxs, error)
- func (c *Local) Unsubscribe(ctx context.Context, subscriber, queryString string) error
- func (c *Local) UnsubscribeAll(ctx context.Context, subscriber string) error
- func (c *Local) Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error)
- type NodeService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Local ¶
type Local struct { *eventbus.EventBus Logger log.Logger // contains filtered or unexported fields }
Local is a Client implementation that directly executes the rpc functions on a given node, without going through HTTP or GRPC.
This implementation is useful for:
* Running tests against a node in-process without the overhead of going through an http server * Communication between an ABCI app and Tendermint core when they are compiled in process.
For real clients, you probably want to use client.HTTP. For more powerful control during testing, you probably want the "client/mock" package.
You can subscribe for any event published by Tendermint using Subscribe method. Note delivery is best-effort. If you don't read events fast enough, Tendermint might cancel the subscription. The client will attempt to resubscribe (you don't need to do anything). It will keep trying indefinitely with exponential backoff (10ms -> 20ms -> 40ms) until successful.
func New ¶
func New(logger log.Logger, node NodeService) (*Local, error)
New configures a client that calls the Node directly.
func (*Local) ABCIQueryWithOptions ¶
func (*Local) BlockByHash ¶
func (*Local) BlockResults ¶
func (*Local) BlockSearch ¶
func (*Local) BlockchainInfo ¶
func (*Local) BroadcastEvidence ¶
func (*Local) BroadcastTx ¶
func (*Local) BroadcastTxAsync ¶
func (*Local) BroadcastTxCommit ¶
func (*Local) BroadcastTxSync ¶
func (*Local) ConsensusParams ¶
func (*Local) ConsensusState ¶
func (*Local) DumpConsensusState ¶
func (*Local) Events ¶
func (c *Local) Events(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error)
func (*Local) GenesisChunked ¶
func (*Local) HeaderByHash ¶
func (*Local) NumUnconfirmedTxs ¶
func (*Local) UnconfirmedTxs ¶
func (*Local) Unsubscribe ¶
func (*Local) UnsubscribeAll ¶
func (*Local) Validators ¶
type NodeService ¶
type NodeService interface { RPCEnvironment() *rpccore.Environment EventBus() *eventbus.EventBus }
NodeService describes the portion of the node interface that the local RPC client constructor needs to build a local client.