chain_index

package
v2.10.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	IsContractAccount(address types.Address) (bool, error)

	LoadOnRoad(gid types.Gid) (map[types.Address]map[types.Address][]ledger.HashHeight, error)

	IterateContracts(iterateFunc func(addr types.Address, meta *ledger.ContractMeta, err error) bool)
}

type IndexDB

type IndexDB struct {
	// contains filtered or unexported fields
}

func NewIndexDB

func NewIndexDB(chainDir string, chain Chain) (*IndexDB, error)

func (*IndexDB) CleanAllData

func (iDB *IndexDB) CleanAllData() error

func (*IndexDB) Close

func (iDB *IndexDB) Close() error

func (*IndexDB) DeleteOnRoad

func (iDB *IndexDB) DeleteOnRoad(toAddress types.Address, sendBlockHash types.Hash)

delete onroad directly

func (*IndexDB) GetAccountAddress

func (iDB *IndexDB) GetAccountAddress(accountId uint64) (*types.Address, error)

func (*IndexDB) GetAccountBlockLocation

func (iDB *IndexDB) GetAccountBlockLocation(addr *types.Address, height uint64) (*chain_file_manager.Location, error)

func (*IndexDB) GetAccountBlockLocationByHash

func (iDB *IndexDB) GetAccountBlockLocationByHash(blockHash *types.Hash) (*chain_file_manager.Location, error)

func (*IndexDB) GetAccountBlockLocationByHeight

func (iDB *IndexDB) GetAccountBlockLocationByHeight(addr *types.Address, height uint64) (*types.Hash, *chain_file_manager.Location, error)

func (*IndexDB) GetAccountBlockLocationList

func (iDB *IndexDB) GetAccountBlockLocationList(hash *types.Hash, count uint64) (*types.Address, []*chain_file_manager.Location, [2]uint64, error)

func (*IndexDB) GetAccountBlockLocationListByHeight

func (iDB *IndexDB) GetAccountBlockLocationListByHeight(addr types.Address, height uint64, count uint64) ([]*chain_file_manager.Location, [2]uint64, error)

func (*IndexDB) GetAccountId

func (iDB *IndexDB) GetAccountId(addr *types.Address) (uint64, error)

func (*IndexDB) GetAddrHeightByHash

func (iDB *IndexDB) GetAddrHeightByHash(blockHash *types.Hash) (*types.Address, uint64, error)

func (*IndexDB) GetConfirmHeightByHash

func (iDB *IndexDB) GetConfirmHeightByHash(blockHash *types.Hash) (uint64, error)

func (*IndexDB) GetLatestAccountBlock

func (iDB *IndexDB) GetLatestAccountBlock(addr *types.Address) (uint64, *chain_file_manager.Location, error)

func (*IndexDB) GetLatestSnapshotBlockLocation

func (iDB *IndexDB) GetLatestSnapshotBlockLocation() (*chain_file_manager.Location, error)

func (*IndexDB) GetOnRoadHashList

func (iDB *IndexDB) GetOnRoadHashList(addr types.Address, pageNum, pageSize int) ([]types.Hash, error)

func (*IndexDB) GetRangeSnapshotBlockLocations

func (iDB *IndexDB) GetRangeSnapshotBlockLocations(startHash *types.Hash, endHash *types.Hash) ([]*chain_file_manager.Location, [2]uint64, error)

func (*IndexDB) GetReceivedBySend

func (iDB *IndexDB) GetReceivedBySend(sendBlockHash *types.Hash) (*types.Hash, error)

func (*IndexDB) GetSnapshotBlockByHeight

func (iDB *IndexDB) GetSnapshotBlockByHeight(height uint64) (*types.Hash, *chain_file_manager.Location, error)

func (*IndexDB) GetSnapshotBlockHeight

func (iDB *IndexDB) GetSnapshotBlockHeight(hash *types.Hash) (uint64, error)

func (*IndexDB) GetSnapshotBlockLocation

func (iDB *IndexDB) GetSnapshotBlockLocation(height uint64) (*chain_file_manager.Location, error)

func (*IndexDB) GetSnapshotBlockLocationByHash

func (iDB *IndexDB) GetSnapshotBlockLocationByHash(hash *types.Hash) (*chain_file_manager.Location, error)

func (*IndexDB) GetSnapshotBlockLocationList

func (iDB *IndexDB) GetSnapshotBlockLocationList(blockHash *types.Hash, higher bool, count uint64) ([]*chain_file_manager.Location, [2]uint64, error)

func (*IndexDB) GetSnapshotBlockLocationListByHeight

func (iDB *IndexDB) GetSnapshotBlockLocationListByHeight(height uint64, higher bool, count uint64) ([]*chain_file_manager.Location, [2]uint64, error)

func (*IndexDB) GetStatus

func (iDB *IndexDB) GetStatus() []interfaces.DBStatus

func (*IndexDB) HasAccount

func (iDB *IndexDB) HasAccount(addr types.Address) (result bool, returnErr error)

func (*IndexDB) Init

func (iDB *IndexDB) Init() error

func (*IndexDB) InitAccountId

func (iDB *IndexDB) InitAccountId()

func (*IndexDB) InsertAccountBlock

func (iDB *IndexDB) InsertAccountBlock(accountBlock *ledger.AccountBlock) error

func (*IndexDB) InsertSnapshotBlock

func (iDB *IndexDB) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock, snapshotBlockLocation *chain_file_manager.Location, abLocationsList []*chain_file_manager.Location)

hash -> height、 height -> blockDB location、confirmed、 account block height -> blockDB location

func (*IndexDB) IsAccountBlockExisted

func (iDB *IndexDB) IsAccountBlockExisted(hash *types.Hash) (bool, error)

func (*IndexDB) IsReceived

func (iDB *IndexDB) IsReceived(sendBlockHash *types.Hash) (bool, error)

func (*IndexDB) IsSnapshotBlockExisted

func (iDB *IndexDB) IsSnapshotBlockExisted(hash *types.Hash) (bool, error)

func (*IndexDB) IterateAccounts

func (iDB *IndexDB) IterateAccounts(iterateFunc func(addr types.Address, accountId uint64, err error) bool)

func (*IndexDB) Load

func (iDB *IndexDB) Load(addrList []types.Address) (map[types.Address]map[types.Address][]ledger.HashHeight, error)

func (*IndexDB) LoadAllHash

func (iDB *IndexDB) LoadAllHash() (map[types.Address][]types.Hash, error)

func (*IndexDB) RollbackAccountBlocks

func (iDB *IndexDB) RollbackAccountBlocks(accountBlocks []*ledger.AccountBlock) error

rollback account blocks

func (*IndexDB) RollbackSnapshotBlocks

func (iDB *IndexDB) RollbackSnapshotBlocks(deletedSnapshotSegments []*ledger.SnapshotChunk, unconfirmedBlocks []*ledger.AccountBlock) error

rollback snapshot blocks

func (*IndexDB) Store

func (iDB *IndexDB) Store() *chain_db.Store

Jump to

Keyboard shortcuts

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