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 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 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
Click to show internal directories.
Click to hide internal directories.