bootstrap

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootstrapper

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

Bootstrapper handles the bootstrapping process for linear chains

func New

func New(config Config, onFinished func(lastReqID uint32) error) *Bootstrapper

New creates a new bootstrapper

func (*Bootstrapper) Add

func (b *Bootstrapper) Add(blockIDs ...ids.ID) error

Add adds blocks to be fetched

func (*Bootstrapper) Clear

func (b *Bootstrapper) Clear()

Clear resets the bootstrapper state

func (*Bootstrapper) GetFailed

func (b *Bootstrapper) GetFailed(nodeID ids.NodeID, requestID uint32) error

GetFailed handles failed fetch requests

func (*Bootstrapper) IsBootstrapped

func (b *Bootstrapper) IsBootstrapped() bool

IsBootstrapped returns whether bootstrapping is complete

func (*Bootstrapper) Put

func (b *Bootstrapper) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, block interface{}) error

Put handles received blocks

func (*Bootstrapper) Start

func (b *Bootstrapper) Start(ctx context.Context, startingHeight uint64) error

Start begins the bootstrapping process

func (*Bootstrapper) Timeout

func (b *Bootstrapper) Timeout() error

Timeout handles request timeouts

type Config

type Config struct {
	// MaxOutstandingRequests is the maximum number of outstanding fetch requests
	MaxOutstandingRequests int

	// MaxProcessingTime is the maximum time to process a single item
	MaxProcessingTime time.Duration

	// RequestTimeout is the timeout for individual requests
	RequestTimeout time.Duration

	// Log is the logger
	Log logging.Logger
}

Config contains the configuration for bootstrapping

Jump to

Keyboard shortcuts

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