Documentation ¶
Index ¶
- type Local
- func (c *Local) ABCIInfo() (*ctypes.ResultABCIInfo, error)
- func (c *Local) ABCIQuery(path string, data bytes.HexBytes) (*ctypes.ResultABCIQuery, error)
- func (c *Local) ABCIQueryWithOptions(path string, data bytes.HexBytes, opts rpcclient.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)
- func (c *Local) Block(height *int64) (*ctypes.ResultBlock, error)
- func (c *Local) BlockInfo(height *int64) (*types.BlockMeta, error)
- func (c *Local) BlockResults(height *int64) (*ctypes.ResultBlockResults, error)
- func (c *Local) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)
- func (c *Local) BroadcastEvidence(ev types.Evidence) (*ctypes.ResultBroadcastEvidence, error)
- func (c *Local) BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *Local) BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error)
- func (c *Local) BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *Local) Commit(height *int64) (*ctypes.ResultCommit, error)
- func (c *Local) ConsensusParams(height *int64) (*ctypes.ResultConsensusParams, error)
- func (c *Local) ConsensusState() (*ctypes.ResultConsensusState, error)
- func (c *Local) DialPeers(peers []string, persistent bool) (*ctypes.ResultDialPeers, error)
- func (c *Local) DialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error)
- func (c *Local) DumpConsensusState() (*ctypes.ResultDumpConsensusState, error)
- func (c *Local) Genesis() (*ctypes.ResultGenesis, error)
- func (c *Local) GetAddressList() (*ctypes.ResultUnconfirmedAddresses, error)
- func (c *Local) GetPendingNonce(address string) (*ctypes.ResultPendingNonce, bool)
- func (l *Local) GetUnconfirmedTxByHash(hash [sha256.Size]byte) (types.Tx, error)
- func (c *Local) Health() (*ctypes.ResultHealth, error)
- func (c *Local) LatestBlockNumber() (int64, error)
- func (c *Local) NetInfo() (*ctypes.ResultNetInfo, error)
- func (c *Local) NumUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error)
- func (c *Local) SetLogger(l log.Logger)
- func (c *Local) Status() (*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(hash []byte, prove bool) (*ctypes.ResultTx, error)
- func (c *Local) TxSearch(query string, prove bool, page, perPage int, orderBy string) (*ctypes.ResultTxSearch, error)
- func (c *Local) UnconfirmedTxs(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) UserNumUnconfirmedTxs(address string) (*ctypes.ResultUserUnconfirmedTxs, error)
- func (c *Local) UserUnconfirmedTxs(address string, limit int) (*ctypes.ResultUserUnconfirmedTxs, error)
- func (c *Local) Validators(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 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 ¶
NewLocal configures a client that calls the Node directly.
Note that given how rpc/core works with package singletons, that you can only have one node per process. So make sure test cases don't run in parallel, or try to simulate an entire network in one process...
func (*Local) ABCIQueryWithOptions ¶
func (c *Local) ABCIQueryWithOptions( path string, data bytes.HexBytes, opts rpcclient.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)
func (*Local) BlockResults ¶
func (c *Local) BlockResults(height *int64) (*ctypes.ResultBlockResults, error)
func (*Local) BlockchainInfo ¶
func (c *Local) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)
func (*Local) BroadcastEvidence ¶
func (*Local) BroadcastTxAsync ¶
func (*Local) BroadcastTxCommit ¶
func (*Local) BroadcastTxSync ¶
func (*Local) ConsensusParams ¶
func (c *Local) ConsensusParams(height *int64) (*ctypes.ResultConsensusParams, error)
func (*Local) ConsensusState ¶
func (c *Local) ConsensusState() (*ctypes.ResultConsensusState, error)
func (*Local) DialSeeds ¶
func (c *Local) DialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error)
func (*Local) DumpConsensusState ¶
func (c *Local) DumpConsensusState() (*ctypes.ResultDumpConsensusState, error)
func (*Local) GetAddressList ¶
func (c *Local) GetAddressList() (*ctypes.ResultUnconfirmedAddresses, error)
func (*Local) GetPendingNonce ¶
func (c *Local) GetPendingNonce(address string) (*ctypes.ResultPendingNonce, bool)
func (*Local) GetUnconfirmedTxByHash ¶
func (*Local) LatestBlockNumber ¶
func (*Local) NumUnconfirmedTxs ¶
func (c *Local) NumUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error)
func (*Local) UnconfirmedTxs ¶
func (c *Local) UnconfirmedTxs(limit int) (*ctypes.ResultUnconfirmedTxs, error)
func (*Local) Unsubscribe ¶
func (*Local) UnsubscribeAll ¶
func (*Local) UserNumUnconfirmedTxs ¶
func (c *Local) UserNumUnconfirmedTxs(address string) (*ctypes.ResultUserUnconfirmedTxs, error)