Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockState ¶
type BlockState interface { GetBlock(blkID ids.ID) (block.Block, choices.Status, error) PutBlock(blk block.Block, status choices.Status) error }
func NewBlockState ¶
func NewBlockState(db database.Database) BlockState
func NewMeteredBlockState ¶
func NewMeteredBlockState(db database.Database, namespace string, metrics prometheus.Registerer) (BlockState, error)
type ChainState ¶
type ChainState interface { SetLastAccepted(blkID ids.ID) error DeleteLastAccepted() error GetLastAccepted() (ids.ID, error) }
func NewChainState ¶
func NewChainState(db database.Database) ChainState
type HeightIndex ¶ added in v0.5.1
type HeightIndex interface { HeightIndexWriter HeightIndexGetter HeightIndexBatchSupport // ResetHeightIndex deletes all index DB entries ResetHeightIndex() error }
HeightIndex contains mapping of blockHeights to accepted proposer block IDs along with some metadata (fork height and checkpoint).
func NewHeightIndex ¶ added in v0.5.1
func NewHeightIndex(db database.Database, commitable versiondb.Commitable) HeightIndex
type HeightIndexBatchSupport ¶ added in v0.5.1
type HeightIndexBatchSupport interface { versiondb.Commitable GetCheckpoint() (ids.ID, error) SetCheckpoint(blkID ids.ID) error DeleteCheckpoint() error }
A checkpoint is the blockID of the next block to be considered for height indexing. We store checkpoints to be able to duly resume long-running re-indexing ops.
type HeightIndexGetter ¶ added in v0.5.1
type HeightIndexWriter ¶ added in v0.5.1
type State ¶
type State interface { ChainState BlockState HeightIndex }
func NewMetered ¶
func NewMetered(db *versiondb.Database, namespace string, metrics prometheus.Registerer) (State, error)
Click to show internal directories.
Click to hide internal directories.