abcicli

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	service.Service

	SetGlobalCallback(GlobalCallback)
	GetGlobalCallback() GlobalCallback
	Error() error

	FlushAsync(ResponseCallback) *ReqRes
	EchoAsync(string, ResponseCallback) *ReqRes
	InfoAsync(types.RequestInfo, ResponseCallback) *ReqRes
	SetOptionAsync(types.RequestSetOption, ResponseCallback) *ReqRes
	DeliverTxAsync(types.RequestDeliverTx, ResponseCallback) *ReqRes
	CheckTxAsync(types.RequestCheckTx, ResponseCallback) *ReqRes
	QueryAsync(types.RequestQuery, ResponseCallback) *ReqRes
	CommitAsync(ResponseCallback) *ReqRes
	InitChainAsync(types.RequestInitChain, ResponseCallback) *ReqRes
	BeginBlockAsync(tmabci.RequestBeginBlock, ResponseCallback) *ReqRes
	EndBlockAsync(types.RequestEndBlock, ResponseCallback) *ReqRes
	BeginRecheckTxAsync(tmabci.RequestBeginRecheckTx, ResponseCallback) *ReqRes
	EndRecheckTxAsync(tmabci.RequestEndRecheckTx, ResponseCallback) *ReqRes
	ListSnapshotsAsync(types.RequestListSnapshots, ResponseCallback) *ReqRes
	OfferSnapshotAsync(types.RequestOfferSnapshot, ResponseCallback) *ReqRes
	LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk, ResponseCallback) *ReqRes
	ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk, ResponseCallback) *ReqRes

	FlushSync() (*types.ResponseFlush, error)
	EchoSync(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) (*tmabci.ResponseCheckTx, error)
	QuerySync(types.RequestQuery) (*types.ResponseQuery, error)
	CommitSync() (*types.ResponseCommit, error)
	InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error)
	BeginBlockSync(tmabci.RequestBeginBlock) (*types.ResponseBeginBlock, error)
	EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error)
	BeginRecheckTxSync(tmabci.RequestBeginRecheckTx) (*tmabci.ResponseBeginRecheckTx, error)
	EndRecheckTxSync(tmabci.RequestEndRecheckTx) (*tmabci.ResponseEndRecheckTx, error)
	ListSnapshotsSync(types.RequestListSnapshots) (*types.ResponseListSnapshots, error)
	OfferSnapshotSync(types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)
	LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)
	ApplySnapshotChunkSync(types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, 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

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"

func NewGRPCClient

func NewGRPCClient(addr string, mustConnect bool) Client

func NewLocalClient

func NewLocalClient(mtx *tmsync.Mutex, app tmabci.Application) Client

NewLocalClient creates a local client, which will be directly calling the methods of the given app.

Both Async and Sync methods ignore the given context.Context parameter.

func NewSocketClient

func NewSocketClient(addr string, mustConnect bool) Client

NewSocketClient creates a new socket client, which connects to a given address. If mustConnect is true, the client will return an error upon start if it fails to connect.

type GlobalCallback

type GlobalCallback func(*tmabci.Request, *tmabci.Response)

type ReqRes

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

func NewReqRes

func NewReqRes(req *tmabci.Request, cb ResponseCallback) *ReqRes

func (*ReqRes) InvokeCallback

func (reqRes *ReqRes) InvokeCallback()

InvokeCallback invokes a thread-safe execution of the configured callback if non-nil.

func (*ReqRes) SetDone

func (reqRes *ReqRes) SetDone(res *tmabci.Response) (set bool)

func (*ReqRes) Wait

func (reqRes *ReqRes) Wait()

type ResponseCallback

type ResponseCallback func(*tmabci.Response)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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