sidecarclient

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartSidecarClient

func StartSidecarClient(
	ctx context.Context,
	t *testing.T,
	config *Config,
	startBlkNum int64,
) chan *common.Block

StartSidecarClient starts a deliver client to fetch committed blocks from the sidecar/ledger service.

Types

type Client

type Client struct {
	broadcastdeliver.DeliverCftClient
}

Client allow connecting to the sidecar to deliver blocks.

func New

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

New instantiate a new sidecar client.

func (*Client) Deliver

func (c *Client) Deliver(ctx context.Context, config *DeliverConfig) error

Deliver start receiving blocks starting from config.StartBlkNum to config.OutputBlock. The value of config.StartBlkNum is updated with the latest block number. This is a wrapper for DeliverCftClient.Deliver to allow easy divergence in the future.

type Config

type Config struct {
	Endpoint  *connection.Endpoint
	ChannelID string
	Retry     *connection.RetryProfile
}

Config is used to define the connection properties to the sidecar.

type DeliverConfig

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

DeliverConfig holds the configuration needed for deliver to run. This is copy of broadcastdeliver.DeliverConfig to allow easy divergence in the future.

Jump to

Keyboard shortcuts

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