Documentation ¶
Overview ¶
Package abciclient provides an ABCI implementation in Go.
There are 3 clients available:
- socket (unix or TCP)
- local (in memory)
- gRPC
## Socket client
The client blocks for enqueuing the request, for enqueuing the Flush to send the request, and for the Flush response to return.
## Local client
The global mutex is locked during each call ¶
## gRPC client
The client waits for all calls to complete.
Index ¶
- type Client
- func NewClient(logger log.Logger, addr, transport string, mustConnect bool) (Client, error)
- func NewGRPCClient(logger log.Logger, addr string, mustConnect bool) Client
- func NewLocalClient(logger log.Logger, app types.Application) Client
- func NewSocketClient(logger log.Logger, addr string, mustConnect bool) Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { service.Service types.Application Error() error Flush(context.Context) error Echo(context.Context, string) (*types.ResponseEcho, error) }
Client defines the interface for an ABCI client.
NOTE these are client errors, eg. ABCI socket connectivity issues. Application-related errors are reflected in response via ABCI error codes and (potentially) error response.
func NewClient ¶
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 ¶
NewGRPCClient creates a gRPC client, which will connect to addr upon the start. Note Client#Start returns an error if connection is unsuccessful and mustConnect is true.
func NewLocalClient ¶
func NewLocalClient(logger log.Logger, app types.Application) Client
NewLocalClient creates a local client, which will be directly calling the methods of the given app.
The client methods ignore their context argument.