Documentation
¶
Overview ¶
Package interfaces defines core consensus interfaces
Package interfaces defines core consensus interfaces.
Index ¶
Constants ¶
View Source
const ( Unknown = vm.Unknown Starting = vm.Starting Syncing = vm.Syncing Bootstrapping = vm.Bootstrapping Ready = vm.Ready Degraded = vm.Degraded Stopping = vm.Stopping Stopped = vm.Stopped )
Re-export State constants from vm package
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BCLookup ¶ added in v1.21.0
type BCLookup interface {
Lookup(alias string) (ids.ID, error)
GetAlias(blockchainID ids.ID) (string, error)
GetBlockchainID(alias string) (ids.ID, error)
PrimaryAlias(blockchainID ids.ID) (string, error)
Aliases(blockchainID ids.ID) ([]string, error)
}
BCLookup provides blockchain lookup functionality
type Block ¶
type Block interface {
// ID returns the block's unique identifier
ID() ids.ID
// Parent returns the parent block's ID
Parent() ids.ID
// Height returns the block's height
Height() uint64
// Bytes returns the serialized block
Bytes() []byte
// Accept marks the block as accepted
Accept(context.Context) error
// Reject marks the block as rejected
Reject(context.Context) error
}
Block represents a consensus block
type ChainState ¶ added in v1.22.31
type ChainState interface {
// GetBlock retrieves a block by its ID
GetBlock(ctx context.Context, blockID ids.ID) (Block, error)
// PutBlock stores a block
PutBlock(ctx context.Context, block Block) error
// GetLastAccepted returns the last accepted block ID
GetLastAccepted(ctx context.Context) (ids.ID, error)
// SetLastAccepted sets the last accepted block ID
SetLastAccepted(ctx context.Context, blockID ids.ID) error
}
ChainState represents the state of the consensus chain
type SharedMemory ¶ added in v1.21.0
type SharedMemory interface {
}
SharedMemory provides shared memory functionality
Click to show internal directories.
Click to hide internal directories.