Documentation ¶
Index ¶
- Variables
- func DataKey(key []byte, index uint64) []byte
- func HashToNumKey(h types.Hash) []byte
- func New(sdb db.Database, maxDepth int64, whitelist map[uint64]types.Hash) storage.Storage
- func NumToHashKey(n uint64) []byte
- func NumberToResumptionKey(n uint64) []byte
- func NumberToWeightKey(n uint64) []byte
- func Open(sdb db.Database, maxDepth int64, whitelist map[uint64]types.Hash) (storage.Storage, error)
- func RangeKey(key []byte) []byte
- func RollbackKey(n uint64) []byte
- type Initializer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HashToNumPrefix = []byte("h") NumToHashPrefix = []byte("n") NumberToWeightPrefix = []byte("w") RangePrefix = []byte("r") DataPrefix = []byte("v") ResumptionDataPrefix = []byte("e") RollbackPrefix = []byte("u") // u for undo LatestBlockHashKey = []byte("LatestBlockHash") LatestBlockWeightKey = []byte("LatestBlockWeight") MemoryPersistenceKey = []byte("MemoryPersistence") )
Functions ¶
func HashToNumKey ¶
func HashToNumKey(h types.Hash) []byte
func NumToHashKey ¶
func NumberToResumptionKey ¶
func NumberToWeightKey ¶
func Open ¶
func Open(sdb db.Database, maxDepth int64, whitelist map[uint64]types.Hash) (storage.Storage, error)
Open loads a archiveStorage instance from a loaded database
func RollbackKey ¶
Types ¶
type Initializer ¶
type Initializer struct {
// contains filtered or unexported fields
}
func NewInitializer ¶
func NewInitializer(db dbpkg.Database) *Initializer
func (*Initializer) AddData ¶
func (init *Initializer) AddData(key, value []byte)
func (*Initializer) Close ¶
func (init *Initializer) Close()
func (*Initializer) SetBlockData ¶
func (init *Initializer) SetBlockData(hash, parentHash types.Hash, number uint64, weight *big.Int)
Click to show internal directories.
Click to hide internal directories.