deliver

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBlockNum uint64 = math.MaxUint64

MaxBlockNum is used for endless deliver.

Variables

This section is empty.

Functions

This section is empty.

Types

type CftClient

type CftClient struct {
	ConnectionManager *ordererconn.ConnectionManager
	Signer            protoutil.Signer
	ChannelID         string
	StreamCreator     func(ctx context.Context, conn grpc.ClientConnInterface) (Stream, error)
}

CftClient allows delivering blocks from one connection at a time. If one connection fails, it will try to connect to another one.

func (*CftClient) Deliver

func (c *CftClient) Deliver(ctx context.Context, p *Parameters) error

Deliver start receiving blocks starting from config.StartBlkNum to config.OutputBlock. The value of config.StartBlkNum is updated with the latest block number.

type Client

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

Client is a collection of nodes and their connections.

func New

func New(config *ordererconn.Config) (*Client, error)

New creates a broadcast/deliver client. It must be closed to release all the associated connections.

func (*Client) CloseConnections added in v0.1.7

func (s *Client) CloseConnections()

CloseConnections closes all the connections for the client.

func (*Client) Deliver

func (s *Client) Deliver(ctx context.Context, p *Parameters) error

Deliver starts the block receiver. The call to Deliver blocks until an error occurs or the context is canceled.

func (*Client) UpdateConnections

func (s *Client) UpdateConnections(config *ordererconn.ConnectionConfig) error

UpdateConnections updates the connection config.

type Parameters

type Parameters struct {
	StartBlkNum int64
	EndBlkNum   uint64
	OutputBlock chan<- *common.Block
}

Parameters needed for deliver to run.

type Stream

type Stream interface {
	Send(*common.Envelope) error
	RecvBlockOrStatus() (*common.Block, *common.Status, error)
	Context() context.Context
}

Stream requires the following interface.

Jump to

Keyboard shortcuts

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