archive

package
v0.0.0-...-8b03266 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//ErrInvalidateRestoreBlocks invalidate restore blocks
	ErrInvalidateRestoreBlocks = errors.New("invalidate restore blocks")
	//ErrConfigBlockArchive config block do not need archive
	ErrConfigBlockArchive = errors.New("config block do not need archive")
	//ErrArchivedTx archived transaction
	ErrArchivedTx = errors.New("archived transaction")
	//ErrArchivedRWSet archived RWSet
	ErrArchivedRWSet = errors.New("archived RWSet")
	//ErrArchivedBlock archived block
	ErrArchivedBlock = errors.New("archived block")
)

Functions

This section is empty.

Types

type ArchiveMgr

type ArchiveMgr struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ArchiveMgr provide handle to archive instances

func NewArchiveMgr

func NewArchiveMgr(chainId string, blockDB blockdb.BlockDB, resultDB resultdb.ResultDB,
	storeConfig *conf.StorageConfig, logger protocol.Logger) (*ArchiveMgr, error)

NewArchiveMgr construct a new `ArchiveMgr` with given chainId

func (*ArchiveMgr) ArchiveBlock

func (mgr *ArchiveMgr) ArchiveBlock(archiveHeight uint64) error

ArchiveBlock cache a block with given block height and update batch

func (*ArchiveMgr) GetArchivedPivot

func (mgr *ArchiveMgr) GetArchivedPivot() (uint64, error)

GetArchivedPivot return restore block pivot

func (*ArchiveMgr) GetMinUnArchiveBlockSize

func (mgr *ArchiveMgr) GetMinUnArchiveBlockSize() uint64

GetMinUnArchiveBlockSize return unarchiveBlockHeight

func (*ArchiveMgr) RestoreBlock

func (mgr *ArchiveMgr) RestoreBlock(blockInfos []*serialization.BlockWithSerializedInfo) error

RestoreBlock restore block from outside block data

Jump to

Keyboard shortcuts

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