Documentation ¶
Index ¶
- func NewLeveldb(dbConfig *leveldbProvider.LevelDbConfig, logger protocol.Logger, ...) (*leveldbProvider.LevelDBHandle, error)
- func NewStoreImportSnapshot(chainID string, storeConfig *conf.StorageConfig, blockDB blockdb.BlockDB, ...) (protocol.ImportLedgerSnapshot, error)
- type LedgerSnapshot
- type Snapshot
- type StoreImportSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLeveldb ¶
func NewLeveldb(dbConfig *leveldbProvider.LevelDbConfig, logger protocol.Logger, chainId string, dbFolder string) (*leveldbProvider.LevelDBHandle, error)
NewLeveldb return a handle of leveldb
func NewStoreImportSnapshot ¶
func NewStoreImportSnapshot( chainID string, storeConfig *conf.StorageConfig, blockDB blockdb.BlockDB, stateDB statedb.StateDB, historyDB historydb.HistoryDB, contractEventDB contracteventdb.ContractEventDB, resultDB resultdb.ResultDB, txExistDB txexistdb.TxExistDB, commonDB protocol.DBHandle, logger protocol.Logger, bfdb binlog.BinLogger, bigFilterDB bigfilterdb.BigFilterDB, meta meta.MetaData) (protocol.ImportLedgerSnapshot, error)
NewStoreImportSnapshot construct ImportSnapshot @Description: @param chainID @param storageConfig @param blockDB @param stateDB @param historyDB @param contractEventDB @param resultDB @param txExistDB @param commonDB @param logger @param bfdb @param bigFilterDB @param metaData @return ImportLedgerSnapshot @return error
Types ¶
type LedgerSnapshot ¶
type LedgerSnapshot interface { // MakeSnapshot get a snapshot task MakeSnapshot(currHeight, height uint64) error // GetSnapshotStatus returns the last snapshot job status, return 0 unfinished, 1 finish GetSnapshotStatus() uint64 // WaitingSnapshotJob wait a snapshot job until snapshot job finish WaitingSnapshotJob(height uint64) error // SendSnapshotIterator send a snapshot iterator to a chan, which includes db iterators and configBlock SendSnapshotIterator(snapshotDir string, height uint64) error // RecevieSnapshotIterator receive a snapshot iterator from chan ,then write snapshot data to file RecevieSnapshotIterator() }
LedgerSnapshot provide make snapshot, get snapshot status and so on.
func NewSnapshot ¶
func NewSnapshot(blockdb blockdb.BlockDB, statedb statedb.StateDB, eventdb contracteventdb.ContractEventDB, logger protocol.Logger, chainID string, storeConfig *conf.StorageConfig) LedgerSnapshot
NewSnapshot create a snapshot
type Snapshot ¶
Snapshot a snapshot ,the implementation todo: 快照中要包含最后写入的区块,要利用这个区块,写到bf(wal)中,否则 wal的 segment中的entry 下标从0开始,和区块块高不能匹配了 所以,快照的应用,要把 segment的下标,set成对应块高,所以利用快照,做apply,要把新节点的wal中的第一个文件创建出来。 以及 各个db 的savepoint 也要做起来
func (*Snapshot) GetSnapshotStatus ¶
GetSnapshotStatus returns the last snapshot job status
func (*Snapshot) MakeSnapshot ¶
MakeSnapshot get a snapshot
func (*Snapshot) RecevieSnapshotIterator ¶
func (s *Snapshot) RecevieSnapshotIterator()
RecevieSnapshotIterator receive a snapshot iterator from chan ,then write snapshot data to file
func (*Snapshot) SendSnapshotIterator ¶
SendSnapshotIterator send a snapshot iterator to a chan, which includes db iterators
type StoreImportSnapshot ¶
type StoreImportSnapshot struct {
// contains filtered or unexported fields
}
StoreImportSnapshot ,import snapshot ,includes statedb,blockdb,bigfilter,txExistdb,wal(bf),metadb,resultdb, historydb,contractEventdb, and so on . @Description