Documentation
¶
Index ¶
- type Bootstrapper
- func (b *Bootstrapper) Add(blockIDs ...ids.ID) error
- func (b *Bootstrapper) Clear()
- func (b *Bootstrapper) GetFailed(nodeID ids.NodeID, requestID uint32) error
- func (b *Bootstrapper) IsBootstrapped() bool
- func (b *Bootstrapper) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, block interface{}) error
- func (b *Bootstrapper) Start(ctx context.Context, startingHeight uint64) error
- func (b *Bootstrapper) Timeout() error
- type Config
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) 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
Click to show internal directories.
Click to hide internal directories.