Documentation
¶
Overview ¶
Package interfaces defines core consensus interfaces
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BCLookup ¶ added in v1.21.0
type BCLookup interface {
// Lookup returns the blockchain ID for an alias
Lookup(alias string) (ids.ID, error)
// GetAlias returns the alias for a blockchain ID
GetAlias(blockchainID ids.ID) (string, error)
// GetBlockchainID returns the blockchain ID for an alias
GetBlockchainID(alias string) (ids.ID, error)
// PrimaryAlias returns the primary alias for a blockchain
PrimaryAlias(blockchainID ids.ID) (string, error)
// Aliases returns all aliases for a blockchain
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 SharedMemory ¶ added in v1.21.0
type SharedMemory interface {
}
SharedMemory provides shared memory functionality
type State ¶
type State 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
}
State represents the state of the consensus
type StateHolder ¶ added in v1.21.0
type StateHolder interface {
// GetState returns the current state
GetState() StateEnum
}
StateHolder holds state information
Click to show internal directories.
Click to hide internal directories.