sync

package
v0.15.20 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

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.Felt]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 *utils.Network,
	log utils.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 *utils.Network, log utils.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,
	log utils.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