peer

package
v0.0.0-...-a15f78a Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {
	Host              string
	Port              int32
	MspID             string
	CACertificates    [][]byte
	ClientCertificate tls.Certificate
}

func (*Peer) String

func (p *Peer) String() string

type Pool

type Pool interface {
	// GetEndorser returns endorser client by peer definition
	GetEndorser(ctx context.Context, p *Peer) (pb.EndorserClient, error)
	// GetRandomEndorser returns random MSP endorser client by peer definition
	GetRandomEndorser(ctx context.Context, mspID string) (pb.EndorserClient, error)
	// GetDeliver returns deliver client by peer definition
	GetDeliver(ctx context.Context, p *Peer) (pb.DeliverClient, error)
	// GetConnection returns random grpc connection for certain MSP
	GetConnection(mspID string) (*grpc.ClientConn, []byte, error)
	// GetDiscoveryClient returns fabric discovery client
	GetDiscoveryClient(mspID string) (discovery.DiscoveryClient, error)
	// Close gracefully closes all pool connections
	Close() error
}

Pool describes common interface for pool of peer clients

func NewGrpcPool

func NewGrpcPool(ctx context.Context, logger *zap.Logger, tlsConf *tls.Config, localPeers []*Peer, _ *matcher.Matcher) (Pool, error)

Jump to

Keyboard shortcuts

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