dao

package
v0.0.0-...-a968a3f Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TryRpcGetBlock func(chain models.DataHolder, h common.Height) (ret *models.BlockEMessage, err error)
	RpcReplayBlock func(target string, request *models.SyncRequest, holder models.DataHolder, end common.Height, logger logrus.FieldLogger)
	RpcGetRRProof  func(rewardChainInfo *common.ChainInfos, rrRoot []byte, logger logrus.FieldLogger) (*models.RRProofs, error)
)

Functions

func BatchSaveWaterline

func BatchSaveWaterline(dbase db.Database, linesMap map[common.ChainID]common.Height) error

func CheckBlockExist

func CheckBlockExist(dbase db.Database, height common.Height) ([]byte, bool)

func GetBlockHash

func GetBlockHash(dbase db.Database, height common.Height) ([]byte, error)

func GetCccTxIndex

func GetCccTxIndex(dbase db.Database, hashOfVcc []byte) (hashOfTx []byte, err error)

func GetChainCommittee

func GetChainCommittee(dbase db.Database, chainID common.ChainID, epochNum common.EpochNum) (*models.Committee, error)

Get Chain Epoch Committee

func GetChainHeightHeader

func GetChainHeightHeader(dbase db.Database, chainID common.ChainID, height common.Height) (*models.HeaderSummary, error)

Gets the HDS information of the specified block confirmed by the main chain, including the block header of the main chain containing the block header (chainid + height) and the packed sub chain block header information (HDS)

func GetChainHeightHeaderSummary

func GetChainHeightHeaderSummary(dbase db.Database, chainID common.ChainID, height common.Height) (*models.HeaderSummary, error)

Gets the block header and sub chain block header information contained in the block specified by chainid+height

func GetDeltaFrom

func GetDeltaFrom(dbase db.Database, fromID common.ChainID, height common.Height) (ok bool,
	deltas []*models.AccountDelta, err error)

func GetTxIndex

func GetTxIndex(dbase db.Database, txHash []byte) (*models.TXIndex, error)

func LoadBlock

func LoadBlock(dbase db.Database, hashOfHeader []byte) (*models.BlockEMessage, error)

func LoadBlockCursor

func LoadBlockCursor(dbase db.Database) (common.Height, []byte, error)

func LoadDeltaFromPoolMaxHeightLocked

func LoadDeltaFromPoolMaxHeightLocked(dbase db.Database, fromID common.ChainID) (common.Height, bool)

func LoadDeltaFroms

func LoadDeltaFroms(olddb db.Database, chainid common.ChainID, shardInfo common.ShardInfo) []*models.ShardDeltaMessage

func LoadEpochCommittee

func LoadEpochCommittee(dbase db.Database, chainId common.ChainID, epoch common.EpochNum) (*models.EpochCommittee, error)

func LoadFirstRewardCursor

func LoadFirstRewardCursor(dbase db.Database) (common.Height, []byte, error)

func LoadRRTrieRoot

func LoadRRTrieRoot(dbase db.Database, era common.EraNum) ([]byte, error)

func LoadReportCursor

func LoadReportCursor(dbase db.Database, chainId common.ChainID) (height common.Height, hashOfBlock []byte, exist bool, err error)

func LoadStorageEntries

func LoadStorageEntries(dbase db.Database, root common.Hash, num int) ([]models.EntryHashHash, error)

func LoadToBeSent

func LoadToBeSent(dbase db.Database) (common.Height, bool)

func LoadUnverifiedBlock

func LoadUnverifiedBlock(dbase db.Database, height common.Height) (*models.BlockEMessage, error)

func LoadWaterlineLocked

func LoadWaterlineLocked(dbase db.Database, fromID common.ChainID) (common.Height, bool)

func PreloadDeltaFromLocked

func PreloadDeltaFromLocked(dbase db.Database, fromID common.ChainID, height common.Height) bool

func RemoveStorageEntries

func RemoveStorageEntries(dbase db.Database, root common.Hash, num int) error

func SaveBlock

func SaveBlock(dbase db.Database, hashOfHeader []byte, block *models.BlockEMessage) (int, error)

Returns the number of saved transaction indexes and errors

func SaveBlockCursor

func SaveBlockCursor(dbase db.Database, chainID common.ChainID, height common.Height, hashOfHeader []byte) error

Block Cursor

func SaveBlockSummary

func SaveBlockSummary(dbase db.Database, hds []*models.BlockSummary) error

Record the block height cursors of all the children chains that have been packaged and confirmed on the parent chain (current is the parent chain)

func SaveBlockTxIndexs

func SaveBlockTxIndexs(dbase db.Database, block *models.BlockEMessage) (count int, err error)

Save transation index in the block

func SaveCccTxIndex

func SaveCccTxIndex(dbase db.Database, hashOfVcc []byte, hashOfTx []byte) error

func SaveChainCommittee

func SaveChainCommittee(dbase db.Database, chainID common.ChainID, epochNum common.EpochNum, committee *models.Committee) error

Save Chain Epoch Committee

func SaveChainHeightHeaders

func SaveChainHeightHeaders(dbase db.Database, chainId common.ChainID, parentId common.ChainID, block *models.BlockEMessage) error

Save all cursors of children chains which have been recorded on parent(reported to) chain (current is one of children chains) chainId: current chain id parentId: chain id reported to block: block of parent chain

func SaveDeltaFromPoolMaxHeightLocked

func SaveDeltaFromPoolMaxHeightLocked(dbase db.Database, fromID common.ChainID, maxHeight common.Height) error

func SaveDeltaFromToDB

func SaveDeltaFromToDB(dbase db.Database, fromID common.ChainID, height common.Height, deltas []*models.AccountDelta) error

func SaveEpochCommittee

func SaveEpochCommittee(dbase db.Writer, chainId common.ChainID, nextEpoch common.EpochNum, ec *models.EpochCommittee) error

func SaveFirstRewardCursor

func SaveFirstRewardCursor(dbase db.Database, height common.Height, hashOfBlock []byte) error

func SaveHeaderIndexes

func SaveHeaderIndexes(dbase db.Database, header *models.BlockHeader) (hashOfHeader []byte, err error)

func SaveNextCommittee

func SaveNextCommittee(dbase db.Database, chainId common.ChainID, nextEpoch common.EpochNum, current, next *models.Committee) error

func SaveRRTrieRoot

func SaveRRTrieRoot(dbase db.Database, era common.EraNum, rootOfRRTrie []byte) error

func SaveReportCursor

func SaveReportCursor(dbase db.Database, chainId common.ChainID, height common.Height, hashOfBlock []byte) error

func SaveToBeSent

func SaveToBeSent(dbase db.Database, toBeSent common.Height) error

func SaveUnverifiedBlock

func SaveUnverifiedBlock(dbase db.Database, height common.Height, block *models.BlockEMessage) error

func SaveWaterlineLocked

func SaveWaterlineLocked(dbase db.Database, fromID common.ChainID, waterline common.Height) error

func SaveWaterlinesSnapshots

func SaveWaterlinesSnapshots(dbase db.Database, how []byte, waterlines models.Waterlines) error

func SetCursorManually

func SetCursorManually(dbase db.Database, id common.ChainID, to common.Height) error

func StoreStorageEntries

func StoreStorageEntries(dbase db.Database, root common.Hash, num int, entries []models.EntryHashHash) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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