sync

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 36 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockBody added in v0.15.3

type BlockBody struct {
	Block       *core.Block
	StateUpdate *core.StateUpdate
	NewClasses  map[felt.ClassHash]core.ClassDefinition
	Commitments *core.BlockCommitments
	Err         error
}

BlockBody is used to mange all the different parts of the blocks require to store the block in the blockchain.Store()

type BlockFetcher added in v0.15.8

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

func NewBlockFetcher added in v0.15.8

func NewBlockFetcher(
	bc *blockchain.Blockchain,
	compiler compiler.Compiler,
	h host.Host,
	n *networks.Network,
	logger log.StructuredLogger,
) BlockFetcher

func (*BlockFetcher) ProcessBlock added in v0.15.8

func (s *BlockFetcher) ProcessBlock(
	ctx context.Context,
	blockNumber uint64,
	outputs chan<- BlockBody,
) error

func (*BlockFetcher) WithListener added in v0.15.8

func (s *BlockFetcher) WithListener(l junoSync.EventListener)

type Client

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

func NewClient

func NewClient(
	newStream NewStreamFunc, snNetwork *networks.Network, logger log.StructuredLogger,
) *Client

func (*Client) RequestBlockHeaders

func (c *Client) RequestBlockHeaders(
	ctx context.Context, req *header.BlockHeadersRequest,
) (iter.Seq[*header.BlockHeadersResponse], error)

func (*Client) RequestClasses

func (*Client) RequestEvents

func (c *Client) RequestEvents(ctx context.Context, req *event.EventsRequest) (iter.Seq[*event.EventsResponse], error)

func (*Client) RequestStateDiffs

func (c *Client) RequestStateDiffs(ctx context.Context, req *state.StateDiffsRequest) (iter.Seq[*state.StateDiffsResponse], error)

type NewStreamFunc

type NewStreamFunc func(ctx context.Context, pids ...protocol.ID) (network.Stream, error)

type Service

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

func New

func New(
	bc *blockchain.Blockchain,
	logger log.StructuredLogger,
	blockFetcher *BlockFetcher,
) *Service

func (*Service) Listen added in v0.15.3

func (s *Service) Listen() <-chan BlockBody

func (*Service) Run

func (s *Service) Run(ctx context.Context)

func (*Service) WithListener

func (s *Service) WithListener(l junoSync.EventListener)

Jump to

Keyboard shortcuts

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