Documentation ¶
Index ¶
Constants ¶
View Source
const CodecVersion = 0
Variables ¶
View Source
var Codec codec.Manager
Functions ¶
This section is empty.
Types ¶
type BlockState ¶
type BlockState interface { GetBlock(blkID ids.ID) (block.Block, error) PutBlock(blk block.Block) error DeleteBlock(blkID ids.ID) 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 ¶
type HeightIndex interface { HeightIndexWriter HeightIndexGetter }
HeightIndex contains mapping of blockHeights to accepted proposer block IDs along with some metadata (fork height and checkpoint).
func NewHeightIndex ¶
func NewHeightIndex(db database.Database, commitable versiondb.Commitable) HeightIndex
type HeightIndexGetter ¶
type HeightIndexGetter interface { // GetMinimumHeight return the smallest height of an indexed blockID. If // there are no indexed blockIDs, ErrNotFound will be returned. GetMinimumHeight() (uint64, error) GetBlockIDAtHeight(height uint64) (ids.ID, error) // Fork height is stored when the first post-fork block/option is accepted. // Before that, fork height won't be found. GetForkHeight() (uint64, error) }
type HeightIndexWriter ¶
type State ¶
type State interface { ChainState BlockState HeightIndex }
func NewMetered ¶
func NewMetered(db *versiondb.Database, namespace string, metrics prometheus.Registerer) (State, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.