blockfetcher

package
v0.108.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultQueueCacheSize is the default size of the queue cache.
	DefaultQueueCacheSize = 16000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Ledger

type Ledger interface {
	GetConfig() config.Blockchain
	BlockHeight() uint32
	HeaderHeight() uint32
}

Ledger is an interface to Blockchain sufficient for Service.

type OperationMode added in v0.108.0

type OperationMode byte

OperationMode is an enum that denotes the operation mode of the Fetcher. It can be either Blocks or Headers.

const (
	// Blocks denotes that the Fetcher is working with blocks.
	Blocks OperationMode = iota
	// Headers denotes that the Fetcher is working with headers.
	Headers
)

type Service

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

Service is a service that fetches blocks from NeoFS.

func New

func New(chain Ledger, cfg config.NeoFSBlockFetcher, logger *zap.Logger, put func(item bqueue.Indexable) error, shutdownCallback func(), opt OperationMode) (*Service, error)

New creates a new BlockFetcher Service.

func (*Service) IsActive

func (bfs *Service) IsActive() bool

IsActive returns true if the NeoFS BlockFetcher service is running.

func (*Service) IsShutdown added in v0.108.0

func (bfs *Service) IsShutdown() bool

IsShutdown returns true if the NeoFS BlockFetcher service is completely shutdown. The service can not be started again.

func (*Service) Shutdown

func (bfs *Service) Shutdown()

Shutdown stops the NeoFS BlockFetcher service. It prevents service from new block OIDs search, cancels all in-progress downloading operations and waits until all service routines finish their work.

func (*Service) Start

func (bfs *Service) Start() error

Start runs the NeoFS BlockFetcher service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳