Thanks to visit codestin.com
Credit goes to pkg.go.dev

sync

package
v0.15.9 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "/starknet"

Variables

This section is empty.

Functions

func ClassesPID

func ClassesPID() protocol.ID

func EventsPID

func EventsPID() protocol.ID

func HeadersPID

func HeadersPID() protocol.ID

func StateDiffPID

func StateDiffPID() protocol.ID

func TransactionsPID

func TransactionsPID() protocol.ID

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,
	h host.Host,
	n *utils.Network,
	log utils.SimpleLogger,
) 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.SimpleLogger) *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.SimpleLogger,
	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