abcicli

package
v0.0.0-...-529655b Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 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 Callback

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

Callback is the signature for response callbacks

type Client

type Client interface {
	service.Service
	SetResponseCallback(Callback)
	Error() error

	// Async methods
	FlushAsync() *ReqRes
	EchoAsync(msg string) *ReqRes
	InfoAsync(types.RequestInfo) *ReqRes
	DeliverTxAsync(types.RequestDeliverTx) *ReqRes
	CheckTxAsync(types.RequestCheckTx) *ReqRes
	QueryAsync(types.RequestQuery) *ReqRes
	CommitAsync() *ReqRes
	InitChainAsync(types.RequestInitChain) *ReqRes
	PrepareProposalAsync(types.RequestPrepareProposal) *ReqRes
	BeginBlockAsync(types.RequestBeginBlock) *ReqRes
	EndBlockAsync(types.RequestEndBlock) *ReqRes
	ListSnapshotsAsync(types.RequestListSnapshots) *ReqRes
	OfferSnapshotAsync(types.RequestOfferSnapshot) *ReqRes
	LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk) *ReqRes
	ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk) *ReqRes
	ProcessProposalAsync(types.RequestProcessProposal) *ReqRes

	// Sync methods
	FlushSync() error
	EchoSync(msg string) (*types.ResponseEcho, error)
	InfoSync(types.RequestInfo) (*types.ResponseInfo, 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)
	PrepareProposalSync(types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)
	BeginBlockSync(types.RequestBeginBlock) (*types.ResponseBeginBlock, error)
	EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, 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)
	ProcessProposalSync(types.RequestProcessProposal) (*types.ResponseProcessProposal, error)
}

Client defines the interface for ABCI client implementations

func NewClient

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

NewClient creates a new ABCI client

func NewGRPCClient

func NewGRPCClient(addr string, mustConnect bool) Client

func NewLocalClient

func NewLocalClient(mtx *bcsync.Mutex, app types.Application) Client

func NewSocketClient

func NewSocketClient(addr string, mustConnect bool) Client

func NewSocketClientWithConfig

func NewSocketClientWithConfig(addr string, mustConnect bool, config *ConnConfig) Client

type ConnConfig

type ConnConfig struct {
	// contains filtered or unexported fields
}

func DefaultConnConfig

func DefaultConnConfig() *ConnConfig

type ReqRes

type ReqRes struct {
	*types.Request
	*sync.WaitGroup
	*types.Response
	// contains filtered or unexported fields
}

ReqRes represents a request-response pair

func NewReqRes

func NewReqRes(req *types.Request) *ReqRes

NewReqRes creates a new request-response pair

func (*ReqRes) GetCallback

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

GetCallback returns the current callback function

func (*ReqRes) InvokeCallback

func (r *ReqRes) InvokeCallback()

InvokeCallback invokes the response callback if set

func (*ReqRes) SetCallback

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

SetCallback sets the response callback

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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