warpsync

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0, BSD-2-Clause Imports: 23 Imported by: ? modules, 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

func WithBlockBatchSize

func WithBlockBatchSize(blockBatchSize int) options.Option[Manager]

WithBlockBatchSize allows to set the size of the block batch returned as part of epoch blocks response.

func WithConcurrency

func WithConcurrency(concurrency int) options.Option[Manager]

WithConcurrency allows to set how many epochs can be requested at once.

Types

type LoadBlockFunc

type LoadBlockFunc func(blockId tangleold.BlockID) (*tangleold.Block, error)

LoadBlockFunc defines a function that returns the block for the given id.

type Manager

type Manager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

The Manager handles the connected neighbors.

func NewManager

func NewManager(p2pManager *p2p.Manager, blockLoaderFunc LoadBlockFunc, blockProcessorFunc ProcessBlockFunc, log *logger.Logger, opts ...options.Option[Manager]) *Manager

NewManager creates a new Manager.

func (*Manager) IsStopped

func (m *Manager) IsStopped() bool

IsStopped returns true if the manager is stopped.

func (*Manager) Stop

func (m *Manager) Stop()

Stop stops the manager and closes all established connections.

func (*Manager) WarpRange

func (m *Manager) WarpRange(ctx context.Context, start, end epoch.Index, startEC epoch.EC, endPrevEC epoch.EC) (err error)

type ProcessBlockFunc

type ProcessBlockFunc func(blk *tangleold.Block, peer *peer.Peer)

ProcessBlockFunc defines a function that processes block's bytes from a given peer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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