Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptorGroup ¶
type AcceptorGroup interface {
RegisterAcceptor(chainID ids.ID, name string, acceptor Acceptor, persist bool) error
DeregisterAcceptor(chainID ids.ID, name string) error
Accept(ctx *Context, containerID ids.ID, container []byte) error
}
AcceptorGroup manages multiple acceptors
func NewAcceptorGroup ¶
func NewAcceptorGroup(log log.Logger) AcceptorGroup
NewAcceptorGroup creates a new acceptor group
type BCLookup ¶
type BCLookup interface {
Lookup(alias string) (ids.ID, error)
PrimaryAlias(id ids.ID) (string, error)
}
BCLookup is the interface for looking up chain IDs by alias
type Context ¶
type Context struct {
// NetworkID is the ID of the network this node is connected to.
NetworkID uint32
// ChainID is the chain this engine is working on.
ChainID ids.ID
// SubnetID is the subnet this engine is working on.
SubnetID ids.ID
// NodeID is the ID of this node.
NodeID ids.NodeID
// BCLookup maps aliases to chain IDs.
BCLookup BCLookup
// Registerer for registering metrics.
Registerer Registerer
// Log is used for logging messages.
Log Logger
// Lock is used to synchronize access to shared resources.
Lock sync.Locker
// ValidatorSet contains the validators for this subnet.
ValidatorSet validators.Set
// ValidatorState provides access to validator information.
ValidatorState ValidatorState
// Sender is used to send messages to other nodes.
Sender Sender
// Bootstrappers are the nodes that are used to bootstrap this chain.
Bootstrappers []ids.NodeID
// StartTime is the time this engine started.
StartTime time.Time
// RequestID is used to create unique request IDs.
RequestID *RequestID
// LUXAssetID is the ID of the LUX asset.
LUXAssetID ids.ID
// State represents the current consensus state
State *EngineState
}
Context contains the state that is used by consensus engines.
type ContextInitializable ¶
type ContextInitializable interface {
InitCtx(ctx *Context)
}
ContextInitializable defines an interface for objects that need context initialization
type Engine ¶
type Engine struct{}
Engine represents the Lux consensus engine This is a stub implementation when the external consensus package is not available
func NewEngineWithParams ¶
NewEngineWithParams creates a new engine with custom parameters
func NewTestEngine ¶
NewTestEngine creates a new engine for testing
type EngineState ¶
type EngineState struct {
State State
}
EngineState represents the state of the consensus engine
type ValidatorState ¶
type ValidatorState interface {
// GetMinimumHeight returns the minimum height of the P-chain.
GetMinimumHeight(ctx context.Context) (uint64, error)
// GetCurrentHeight returns the current height of the P-chain.
GetCurrentHeight(ctx context.Context) (uint64, error)
// GetSubnetID returns the subnet ID for the given chain ID.
GetSubnetID(ctx context.Context, chainID ids.ID) (ids.ID, error)
// GetValidatorSet returns the validators of the given subnet at the
// given P-chain height.
GetValidatorSet(
ctx context.Context,
height uint64,
subnetID ids.ID,
) (map[ids.NodeID]*validators.GetValidatorOutput, error)
}
ValidatorState provides access to validator information
Directories
¶
| Path | Synopsis |
|---|---|
|
crypto
|
|
|
dag/vertex/vertexmock
Package vertexmock is a generated GoMock package.
|
Package vertexmock is a generated GoMock package. |
|
engines
|
|
|
networking
|
|
|
router/routermock
Package routermock is a generated GoMock package.
|
Package routermock is a generated GoMock package. |
|
tracker/trackermock
Package trackermock is a generated GoMock package.
|
Package trackermock is a generated GoMock package. |
|
SPDX-License-Identifier: BUSL-1.1
|
SPDX-License-Identifier: BUSL-1.1 |
|
ringtail
Package ringtail provides placeholder implementations for the Ringtail cryptographic library
|
Package ringtail provides placeholder implementations for the Ringtail cryptographic library |
|
uptimemock
Package uptimemock is a generated GoMock package.
|
Package uptimemock is a generated GoMock package. |
|
validatorsmock
Package validatorsmock is a generated GoMock package.
|
Package validatorsmock is a generated GoMock package. |