Documentation
¶
Index ¶
- type Blocker
- type BootstrapableEngine
- type Bootstrapper
- func (b *Bootstrapper) Ancestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error
- func (b *Bootstrapper) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, ...) error
- func (b *Bootstrapper) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion string) error
- func (b *Bootstrapper) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (b *Bootstrapper) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error
- func (b *Bootstrapper) GetFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (b *Bootstrapper) HealthCheck(ctx context.Context) (interface{}, error)
- func (b *Bootstrapper) IsBootstrapped() bool
- func (b *Bootstrapper) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error
- func (b *Bootstrapper) PushQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxBytes []byte) error
- func (b *Bootstrapper) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxBytes []byte) error
- func (b *Bootstrapper) QueryFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32) error
- func (b *Bootstrapper) Shutdown(ctx context.Context) error
- func (b *Bootstrapper) Start(ctx context.Context, startReqID uint32) error
- type Config
- type Halter
- type LinearizableVM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blocker ¶ added in v1.22.46
type Blocker interface {
// Register registers a job to be unblocked
Register(ctx context.Context, id ids.ID) (bool, error)
// PushJob pushes a job to be processed
PushJob(ctx context.Context, id ids.ID) error
// Unblock marks a job as unblocked
Unblock(ctx context.Context, id ids.ID) error
// Clear clears all blocked jobs
Clear()
}
Blocker blocks/unblocks processing
type BootstrapableEngine ¶ added in v1.22.46
type BootstrapableEngine interface {
// Start starts the engine
Start(ctx context.Context, startReqID uint32) error
// HealthCheck checks engine health
HealthCheck(ctx context.Context) (interface{}, error)
// Shutdown shuts down the engine
Shutdown(ctx context.Context) error
// IsBootstrapped returns whether bootstrapping is complete
IsBootstrapped() bool
}
BootstrapableEngine is an engine that can be bootstrapped
type Bootstrapper ¶
type Bootstrapper struct {
// contains filtered or unexported fields
}
Bootstrapper bootstraps a DAG chain
func New ¶
func New(config Config, onFinished func(ctx context.Context, lastReqID uint32) error) (*Bootstrapper, error)
New creates a new DAG bootstrapper
func Trace ¶ added in v1.22.46
func Trace(b *Bootstrapper, tracer interface{}) *Bootstrapper
Trace wraps a bootstrapper with tracing
func (*Bootstrapper) Ancestors ¶ added in v1.22.46
func (b *Bootstrapper) Ancestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, containers [][]byte) error
Ancestors handles received ancestors
func (*Bootstrapper) Chits ¶ added in v1.22.46
func (b *Bootstrapper) Chits(ctx context.Context, nodeID ids.NodeID, requestID uint32, preferredID ids.ID, preferredIDAtHeight ids.ID, acceptedID ids.ID) error
Chits handles chit messages
func (*Bootstrapper) Disconnected ¶
Disconnected handles peer disconnection
func (*Bootstrapper) GetAncestors ¶ added in v1.22.46
func (b *Bootstrapper) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error
GetAncestors handles ancestor requests
func (*Bootstrapper) HealthCheck ¶
func (b *Bootstrapper) HealthCheck(ctx context.Context) (interface{}, error)
HealthCheck returns health information
func (*Bootstrapper) IsBootstrapped ¶ added in v1.22.46
func (b *Bootstrapper) IsBootstrapped() bool
IsBootstrapped returns whether bootstrapping is complete
func (*Bootstrapper) PullQuery ¶ added in v1.22.46
func (b *Bootstrapper) PullQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error
PullQuery handles pull query
func (*Bootstrapper) PushQuery ¶ added in v1.22.46
func (b *Bootstrapper) PushQuery(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxBytes []byte) error
PushQuery handles push query
func (*Bootstrapper) Put ¶ added in v1.22.46
func (b *Bootstrapper) Put(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxBytes []byte) error
Put handles vertex put
func (*Bootstrapper) QueryFailed ¶ added in v1.22.46
QueryFailed handles query failure
type Config ¶ added in v1.22.46
type Config struct {
// AllGetsServer handles ancestor fetching
AllGetsServer getter.Handler
// Ctx is the consensus context
Ctx context.Context
// Beacons are the validators used for bootstrapping
Beacons interface {
TotalWeight(netID ids.ID) (uint64, error)
}
// StartupTracker tracks startup progress
StartupTracker interface {
ShouldStart() bool
}
// Sender sends messages to peers
Sender interface {
SendGetAncestors(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error
}
// AncestorsMaxContainersReceived limits the number of containers received
AncestorsMaxContainersReceived int
// VtxBlocked is the blocker for vertex processing
VtxBlocked Blocker
// TxBlocked is the blocker for transaction processing
TxBlocked Blocker
// Manager manages vertex state
Manager state.Manager
// VM is the linearizable DAG VM
VM LinearizableVM
// Haltable provides halt functionality
Haltable Halter
// StopVertexID is an optional vertex ID to stop at (for upgrades)
StopVertexID ids.ID
}
Config configures the DAG bootstrapper
type Halter ¶ added in v1.22.46
type Halter interface {
// Halt stops execution
Halt(ctx context.Context)
// Halted returns whether halted
Halted() bool
}
Halter can halt execution
type LinearizableVM ¶ added in v1.22.46
type LinearizableVM interface {
// Linearize converts DAG to linear chain
Linearize(ctx context.Context, stopVertexID ids.ID) error
// ParseVtx parses a vertex from bytes
ParseVtx(ctx context.Context, bytes []byte) (state.Vertex, error)
}
LinearizableVM is a DAG VM that can be linearized