proxy

package
v0.0.0-...-5f4adf5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetricsSubsystem is a subsystem shared by all metrics exposed by this
	// package.
	MetricsSubsystem = "abci_connection"
)

Variables

View Source
var RequestInfo = &abci.RequestInfo{
	Version:      version.TMCoreSemVer,
	BlockVersion: version.BlockProtocol,
	P2PVersion:   version.P2PProtocol,
	AbciVersion:  version.ABCIVersion,
}

RequestInfo contains all the information for sending the abci.RequestInfo message during handshake with the app. It contains only compile-time version information.

Functions

This section is empty.

Types

type AppConnMempool

type AppConnMempool interface {
	SetResponseCallback(abcicli.Callback)
	Error() error

	CheckTx(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)
	CheckTxAsync(context.Context, *types.RequestCheckTx) (*abcicli.ReqRes, error)
	Flush(context.Context) error
}

func NewAppConnMempool

func NewAppConnMempool(appConn abcicli.Client, metrics *Metrics) AppConnMempool

type AppConnQuery

func NewAppConnQuery

func NewAppConnQuery(appConn abcicli.Client, metrics *Metrics) AppConnQuery

type AppConns

type AppConns interface {
	service.Service

	// Mempool connection
	Mempool() AppConnMempool
	// Consensus connection
	Consensus() AppConnConsensus
	// Query connection
	Query() AppConnQuery
	// Snapshot connection
	Snapshot() AppConnSnapshot
}

AppConns is the CometBFT's interface to the application that consists of multiple connections.

func NewAppConns

func NewAppConns(clientCreator ClientCreator, metrics *Metrics) AppConns

NewAppConns calls NewMultiAppConn.

func NewMultiAppConn

func NewMultiAppConn(clientCreator ClientCreator, metrics *Metrics) AppConns

NewMultiAppConn makes all necessary abci connections to the application.

type ClientCreator

type ClientCreator interface {
	// NewABCIClient returns a new ABCI client.
	NewABCIClient() (abcicli.Client, error)
}

ClientCreator creates new ABCI clients.

func DefaultClientCreator

func DefaultClientCreator(addr, transport, dbDir string) ClientCreator

DefaultClientCreator returns a default ClientCreator, which will create a local client if addr is one of "kvstore", "persistent_kvstore", "e2e", "noop".

Otherwise a remote client will be created.

Each of "kvstore", "persistent_kvstore" and "e2e" also currently have an "_unsync" variant (i.e. "kvstore_unsync", etc.), which attempts to replicate the same concurrency model as the remote client.

func NewLocalClientCreator

func NewLocalClientCreator(app types.Application) ClientCreator

NewLocalClientCreator returns a ClientCreator for the given app, which will be running locally.

Maintains a single mutex over all new clients created with NewABCIClient. For a local client creator that uses a single mutex per new client, rather use NewUnsyncLocalClientCreator.

func NewRemoteClientCreator

func NewRemoteClientCreator(addr, transport string, mustConnect bool) ClientCreator

NewRemoteClientCreator returns a ClientCreator for the given address (e.g. "192.168.0.1") and transport (e.g. "tcp"). Set mustConnect to true if you want the client to connect before reporting success.

func NewUnsyncLocalClientCreator

func NewUnsyncLocalClientCreator(app types.Application) ClientCreator

NewUnsyncLocalClientCreator returns a ClientCreator for the given app. Unlike NewLocalClientCreator, each call to NewABCIClient returns an ABCI client that maintains its own mutex over the application.

type Metrics

type Metrics struct {
	// Timing for each ABCI method.
	MethodTimingSeconds metrics.Histogram `metrics_bucketsizes:".0001,.0004,.002,.009,.02,.1,.65,2,6,25" metrics_labels:"method, type"`
}

Metrics contains the prometheus metrics exposed by the proxy package.

func NopMetrics

func NopMetrics() *Metrics

func PrometheusMetrics

func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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