blockretainer

package
v1.0.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

NewProvider creates a new BlockRetainer provider.

Types

type BlockRetainer

type BlockRetainer struct {
	sync.RWMutex
	module.Module
	// contains filtered or unexported fields
}

func New

func New(module module.Module, workersGroup *workerpool.Group, retainerStoreFunc StoreFunc, finalizedSlotFunc FinalizedSlotFunc, errorHandler func(error)) *BlockRetainer

func (*BlockRetainer) BlockMetadata

func (r *BlockRetainer) BlockMetadata(blockID iotago.BlockID) (*api.BlockMetadataResponse, error)

func (*BlockRetainer) CommitSlot

func (r *BlockRetainer) CommitSlot(committedSlot iotago.SlotIndex) error

func (*BlockRetainer) OnBlockAccepted

func (r *BlockRetainer) OnBlockAccepted(blockID iotago.BlockID) error

func (*BlockRetainer) OnBlockBooked

func (r *BlockRetainer) OnBlockBooked(block *blocks.Block) error

OnBlockBooked triggers storing block in the retainer on block booked event.

func (*BlockRetainer) OnBlockConfirmed

func (r *BlockRetainer) OnBlockConfirmed(blockID iotago.BlockID) error

func (*BlockRetainer) OnBlockDropped

func (r *BlockRetainer) OnBlockDropped(blockID iotago.BlockID) error

func (*BlockRetainer) Reset

func (r *BlockRetainer) Reset()

Reset resets the component to a clean state as if it was created at the last commitment.

func (*BlockRetainer) Shutdown

func (r *BlockRetainer) Shutdown()

func (*BlockRetainer) UpdateBlockMetadata

func (r *BlockRetainer) UpdateBlockMetadata(blockID iotago.BlockID, state api.BlockState) error

type FinalizedSlotFunc

type FinalizedSlotFunc func() iotago.SlotIndex

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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