syncer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeadSyncer

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

func NewHeadSyncer

func NewHeadSyncer(o HeadSyncerOpts) (*HeadSyncer, error)

func (*HeadSyncer) Start

func (hs *HeadSyncer) Start(ctx context.Context) error

Start creates a websocket subscription and actively receives new blocks until stopped or a critical error occurs.

type HeadSyncerOpts

type HeadSyncerOpts struct {
	Logg       logf.Logger
	Pipeline   *pipeline.Pipeline
	Pool       *pond.WorkerPool
	Stats      *Stats
	WsEndpoint string
}

type Janitor

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

func NewJanitor

func NewJanitor(o JanitorOpts) *Janitor

func (*Janitor) QueueMissingBlocks

func (j *Janitor) QueueMissingBlocks(ctx context.Context) error

QueueMissingBlocks searches for missing block and queues the block for processing. It will run twice for a given search range and only after, raise the lower bound.

func (*Janitor) Start

func (j *Janitor) Start(ctx context.Context) error

type JanitorOpts

type JanitorOpts struct {
	BatchSize     uint64
	Logg          logf.Logger
	Pipeline      *pipeline.Pipeline
	Pool          *pond.WorkerPool
	Stats         *Stats
	Store         store.Store[pgx.Rows]
	SweepInterval time.Duration
}

type Stats

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

Stats synchronizes block cursors values across the head and janitor.

func (*Stats) GetHeadCursor

func (s *Stats) GetHeadCursor() uint64

func (*Stats) GetLowerBound

func (s *Stats) GetLowerBound() uint64

func (*Stats) UpdateHeadCursor

func (s *Stats) UpdateHeadCursor(val uint64)

func (*Stats) UpdateLowerBound

func (s *Stats) UpdateLowerBound(val uint64)

Jump to

Keyboard shortcuts

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