snapshot

package
v0.0.0-...-471f645 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SnapshotInterval uint64 = 3600000

Functions

This section is empty.

Types

type BlockInfo

type BlockInfo struct {
	Number    uint64
	BlockHash common.Hash
	Timestamp uint64 // previous snapshot timestamp
}

BlockInfo store stateDB

type SnapshotManager

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

SnapshotManager snapshot manager object

func NewSnapshotManager

func NewSnapshotManager(state *state.StateDB) *SnapshotManager

NewSnapshotManager create manager

func (*SnapshotManager) GetCurrentSnapshotHash

func (sn *SnapshotManager) GetCurrentSnapshotHash() (uint64, common.Hash, error)

func (*SnapshotManager) GetLastSnapshotTime

func (sn *SnapshotManager) GetLastSnapshotTime() (uint64, error)

GetLastSnapshot get last snapshot time

func (*SnapshotManager) GetPrevSnapshotTime

func (sn *SnapshotManager) GetPrevSnapshotTime(time uint64) (uint64, error)

GetPrevSnapshot get previous snapshot time

func (*SnapshotManager) GetSnapshotMsg

func (sn *SnapshotManager) GetSnapshotMsg(account string, key string, time uint64) ([]byte, error)

func (*SnapshotManager) GetSnapshotState

func (sn *SnapshotManager) GetSnapshotState(time uint64) (*state.StateDB, error)

GetSnapshotState get snapshot state

func (*SnapshotManager) SetSnapshot

func (sn *SnapshotManager) SetSnapshot(time uint64, blockInfo BlockInfo) error

Jump to

Keyboard shortcuts

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