tendermint: github.com/tendermint/tendermint/abci/client Index | Files

package abcicli

import "github.com/tendermint/tendermint/abci/client"


Package Files

client.go grpc_client.go local_client.go socket_client.go

func NewGRPCClient Uses

func NewGRPCClient(addr string, mustConnect bool) *grpcClient

func NewLocalClient Uses

func NewLocalClient(mtx *sync.Mutex, app types.Application) *localClient

func NewSocketClient Uses

func NewSocketClient(addr string, mustConnect bool) *socketClient

type Callback Uses

type Callback func(*types.Request, *types.Response)

type Client Uses

type Client interface {

    Error() error

    FlushAsync() *ReqRes
    EchoAsync(msg string) *ReqRes
    InfoAsync(types.RequestInfo) *ReqRes
    SetOptionAsync(types.RequestSetOption) *ReqRes
    DeliverTxAsync(types.RequestDeliverTx) *ReqRes
    CheckTxAsync(types.RequestCheckTx) *ReqRes
    QueryAsync(types.RequestQuery) *ReqRes
    CommitAsync() *ReqRes
    InitChainAsync(types.RequestInitChain) *ReqRes
    BeginBlockAsync(types.RequestBeginBlock) *ReqRes
    EndBlockAsync(types.RequestEndBlock) *ReqRes

    FlushSync() error
    EchoSync(msg string) (*types.ResponseEcho, error)
    InfoSync(types.RequestInfo) (*types.ResponseInfo, error)
    SetOptionSync(types.RequestSetOption) (*types.ResponseSetOption, error)
    DeliverTxSync(types.RequestDeliverTx) (*types.ResponseDeliverTx, error)
    CheckTxSync(types.RequestCheckTx) (*types.ResponseCheckTx, error)
    QuerySync(types.RequestQuery) (*types.ResponseQuery, error)
    CommitSync() (*types.ResponseCommit, error)
    InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error)
    BeginBlockSync(types.RequestBeginBlock) (*types.ResponseBeginBlock, error)
    EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error)

Client defines an interface for an ABCI client. All `Async` methods return a `ReqRes` object. All `Sync` methods return the appropriate protobuf ResponseXxx struct and an error. Note these are client errors, eg. ABCI socket connectivity issues. Application-related errors are reflected in response via ABCI error codes and logs.

func NewClient Uses

func NewClient(addr, transport string, mustConnect bool) (client Client, err error)

NewClient returns a new ABCI client of the specified transport type. It returns an error if the transport is not "socket" or "grpc"

type ReqRes Uses

type ReqRes struct {
    *types.Response // Not set atomically, so be sure to use WaitGroup.
    // contains filtered or unexported fields

func NewReqRes Uses

func NewReqRes(req *types.Request) *ReqRes

func (*ReqRes) GetCallback Uses

func (reqRes *ReqRes) GetCallback() func(*types.Response)

func (*ReqRes) SetCallback Uses

func (reqRes *ReqRes) SetCallback(cb func(res *types.Response))

Sets the callback for this ReqRes atomically. If reqRes is already done, calls cb immediately. NOTE: reqRes.cb should not change if reqRes.done. NOTE: only one callback is supported.

func (*ReqRes) SetDone Uses

func (reqRes *ReqRes) SetDone()

NOTE: it should be safe to read reqRes.cb without locks after this.

Package abcicli imports 13 packages (graph) and is imported by 8 packages. Updated 2019-11-16. Refresh now. Tools for package owners.