deliver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToQueue added in v0.2.0

func ToQueue(ctx context.Context, p Parameters) error

ToQueue connects to a delivery server and delivers the stream to a queue (go channel). It returns when an error occurs or when the context is done. It will attempt to reconnect on errors.

Types

type BlockWithSourceID added in v0.2.0

type BlockWithSourceID struct {
	SourceID uint32
	Block    *common.Block
}

BlockWithSourceID can provide extra information on the block source when aggregating multiple sources into a single output channel.

type Deliverer added in v0.2.0

type Deliverer interface {
	Deliver(ctx context.Context) (Streamer, error)
}

Deliverer establishes a delivery stream connection to a block source (orderer or peer). Implementations are responsible for creating and managing the underlying gRPC stream.

type Parameters

type Parameters struct {
	Deliverer               Deliverer
	ChannelID               string
	Signer                  identity.SignerSerializer
	TLSCertHash             []byte
	NextBlockNum            uint64
	OutputBlock             chan<- *common.Block
	OutputBlockWithSourceID chan<- *BlockWithSourceID
	HeaderOnly              bool
	SourceID                uint32
	Retry                   *retry.Profile
}

Parameters holds the parameters for delivery.

type Streamer added in v0.2.0

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

Streamer represents an active delivery stream for receiving blocks from a block source. It provides methods to send seek requests, receive blocks or status messages, and access the underlying stream context for cancellation and metadata.

Jump to

Keyboard shortcuts

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