abciclient

package
v0.37.0-dev Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: Apache-2.0 Imports: 15 Imported by: 269

Documentation

Overview

Package abciclient provides an ABCI implementation in Go.

There are 3 clients available:

  1. socket (unix or TCP)
  2. local (in memory)
  3. 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

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

func NewClient(logger log.Logger, addr, transport string, mustConnect bool) (Client, 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(logger log.Logger, addr string, mustConnect bool) Client

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.

func NewSocketClient

func NewSocketClient(logger log.Logger, 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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