archive

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

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

@Description:

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

@Description:
@param chainId
@param blockDB
@param resultDB
@param storeConfig
@param logger
@return *ArchiveMgr
@return error

func (*ArchiveMgr) ArchiveBlock

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

ArchiveBlock cache a block with given block height and update batch

@Description:
@receiver mgr
@param archiveHeight
@return error

func (*ArchiveMgr) GetArchivedPivot

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

GetArchivedPivot return restore block pivot

@Description:
@receiver mgr
@return uint64
@return error

func (*ArchiveMgr) GetMinUnArchiveBlockSize

func (mgr *ArchiveMgr) GetMinUnArchiveBlockSize() uint64

GetMinUnArchiveBlockSize return unarchiveBlockHeight

@Description:
@receiver mgr
@return uint64

func (*ArchiveMgr) RestoreBlock

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

RestoreBlock restore block from outside block data

@Description:
@receiver mgr
@param blockInfos
@return error

Jump to

Keyboard shortcuts

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