prunable

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2023 License: Apache-2.0, BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocks

type Blocks struct {
	Storage func(index slot.Index) kvstore.KVStore
}

func NewBlocks

func NewBlocks(dbManager *database.Manager, storagePrefix byte) (newBlocks *Blocks)

func (*Blocks) Delete

func (b *Blocks) Delete(id models.BlockID) (err error)

func (*Blocks) ForEachBlockInSlot

func (b *Blocks) ForEachBlockInSlot(index slot.Index, consumer func(blockID models.BlockID) bool) error

func (*Blocks) Load

func (b *Blocks) Load(id models.BlockID) (block *models.Block, err error)

func (*Blocks) Store

func (b *Blocks) Store(block *models.Block) (err error)

type Prunable

type Prunable struct {
	Blocks           *Blocks
	RootBlocks       *RootBlocks
	Attestations     func(index slot.Index) kvstore.KVStore
	LedgerStateDiffs func(index slot.Index) kvstore.KVStore
}

func New

func New(dbManager *database.Manager) (newPrunable *Prunable)

type RootBlocks

type RootBlocks struct {
	Storage func(index slot.Index) kvstore.KVStore
}

func NewRootBlocks

func NewRootBlocks(databaseInstance *database.Manager, storagePrefix byte) (newRootBlocks *RootBlocks)

NewRootBlocks creates a new RootBlocks instance.

func (*RootBlocks) Delete

func (r *RootBlocks) Delete(blockID models.BlockID) (err error)

Delete deletes the given blockID from the root blocks.

func (*RootBlocks) Has

func (r *RootBlocks) Has(blockID models.BlockID) (has bool, err error)

Has returns true if the given blockID is a root block.

func (*RootBlocks) Store

func (r *RootBlocks) Store(id models.BlockID, commitmentID commitment.ID) (err error)

Store stores the given blockID as a root block.

func (*RootBlocks) Stream

func (r *RootBlocks) Stream(index slot.Index, processor func(id models.BlockID, commitmentID commitment.ID) error) (err error)

Stream streams all root blocks for a slot index.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL