abcicli

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalClient

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

Types

type Callback

type Callback func(abci.Request, abci.Response)

type Client

type Client interface {
	service.Service

	SetResponseCallback(Callback)
	Error() error

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

	FlushSync() error
	EchoSync(msg string) (abci.ResponseEcho, error)
	InfoSync(abci.RequestInfo) (abci.ResponseInfo, error)
	SetOptionSync(abci.RequestSetOption) (abci.ResponseSetOption, error)
	DeliverTxSync(abci.RequestDeliverTx) (abci.ResponseDeliverTx, error)
	CheckTxSync(abci.RequestCheckTx) (abci.ResponseCheckTx, error)
	QuerySync(abci.RequestQuery) (abci.ResponseQuery, error)
	CommitSync() (abci.ResponseCommit, error)
	InitChainSync(abci.RequestInitChain) (abci.ResponseInitChain, error)
	BeginBlockSync(abci.RequestBeginBlock) (abci.ResponseBeginBlock, error)
	EndBlockSync(abci.RequestEndBlock) (abci.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.

type ReqRes

type ReqRes struct {
	abci.Request

	abci.Response
	// contains filtered or unexported fields
}

func NewReqRes

func NewReqRes(req abci.Request) *ReqRes

func (*ReqRes) Done

func (reqRes *ReqRes) Done()

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

func (*ReqRes) GetCallback

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

func (*ReqRes) SetCallback

func (reqRes *ReqRes) SetCallback(cb func(res abci.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) SetResponse

func (reqRes *ReqRes) SetResponse(res abci.Response)

func (*ReqRes) Wait

func (reqRes *ReqRes) Wait()

Wait will wait until SetResponse() is called.

Jump to

Keyboard shortcuts

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