Documentation ¶
Index ¶
- type Local
- func (c *Local) ABCIInfo(context.Context) (*ctypes.ResultABCIInfo, error)
- func (c *Local) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*ctypes.ResultABCIQuery, error)
- func (c *Local) ABCIQueryWithOptions(_ context.Context, path string, data bytes.HexBytes, ...) (*ctypes.ResultABCIQuery, error)
- func (c *Local) Block(_ context.Context, height *int64) (*ctypes.ResultBlock, error)
- func (c *Local) BlockByHash(_ context.Context, hash []byte) (*ctypes.ResultBlock, error)
- func (c *Local) BlockResults(_ context.Context, height *int64) (*ctypes.ResultBlockResults, error)
- func (c *Local) BlockSearch(_ context.Context, query string, page, perPage *int, orderBy string) (*ctypes.ResultBlockSearch, error)
- func (c *Local) BlockchainInfo(_ context.Context, minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)
- func (c *Local) BroadcastEvidence(_ context.Context, ev types.Evidence) (*ctypes.ResultBroadcastEvidence, error)
- func (c *Local) BroadcastTxAsync(_ context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *Local) BroadcastTxCommit(_ context.Context, tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error)
- func (c *Local) BroadcastTxSync(_ context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *Local) CheckTx(_ context.Context, tx types.Tx) (*ctypes.ResultCheckTx, error)
- func (c *Local) Commit(_ context.Context, height *int64) (*ctypes.ResultCommit, error)
- func (c *Local) ConsensusParams(_ context.Context, height *int64) (*ctypes.ResultConsensusParams, error)
- func (c *Local) ConsensusState(context.Context) (*ctypes.ResultConsensusState, error)
- func (c *Local) DialPeers(_ context.Context, peers []string, persistent, unconditional, private bool) (*ctypes.ResultDialPeers, error)
- func (c *Local) DialSeeds(_ context.Context, seeds []string) (*ctypes.ResultDialSeeds, error)
- func (c *Local) DumpConsensusState(context.Context) (*ctypes.ResultDumpConsensusState, error)
- func (c *Local) Genesis(context.Context) (*ctypes.ResultGenesis, error)
- func (c *Local) GenesisChunked(_ context.Context, id uint) (*ctypes.ResultGenesisChunk, error)
- func (c *Local) Header(_ context.Context, height *int64) (*ctypes.ResultHeader, error)
- func (c *Local) HeaderByHash(_ context.Context, hash bytes.HexBytes) (*ctypes.ResultHeader, error)
- func (c *Local) Health(context.Context) (*ctypes.ResultHealth, error)
- func (c *Local) NetInfo(context.Context) (*ctypes.ResultNetInfo, error)
- func (c *Local) NumUnconfirmedTxs(context.Context) (*ctypes.ResultUnconfirmedTxs, error)
- func (c *Local) SetLogger(l log.Logger)
- func (c *Local) Status(context.Context) (*ctypes.ResultStatus, error)
- func (c *Local) Subscribe(ctx context.Context, subscriber, query string, outCapacity ...int) (out <-chan ctypes.ResultEvent, err error)
- func (c *Local) Tx(_ context.Context, hash []byte, prove bool) (*ctypes.ResultTx, error)
- func (c *Local) TxSearch(_ context.Context, query string, prove bool, page, perPage *int, ...) (*ctypes.ResultTxSearch, error)
- func (c *Local) UnconfirmedTxs(_ context.Context, limit *int) (*ctypes.ResultUnconfirmedTxs, error)
- func (c *Local) Unsubscribe(ctx context.Context, subscriber, query string) error
- func (c *Local) UnsubscribeAll(ctx context.Context, subscriber string) error
- func (c *Local) Validators(_ context.Context, height *int64, page, perPage *int) (*ctypes.ResultValidators, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Local ¶
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 CometBFT 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 CometBFT using Subscribe method. Note delivery is best-effort. If you don't read events fast enough, CometBFT 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.