hashdb

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Defaults = &Config{

	CleanCacheSize: 0,
}

Defaults is the default setting for database if it's not specified. Notably, clean cache is disabled explicitly,

Functions

func ParallelWorker

func ParallelWorker(total, nThds int, worker func(start, end, idx int, args ...interface{}), args ...interface{})

Types

type ChildResolver

type ChildResolver interface {
	ForEach(node []byte, onChild func(common.Hash))
}

ChildResolver defines the required method to decode the provided trie node and iterate the children on top.

type Config

type Config struct {
	CleanCacheSize int // Maximum memory allowance (in bytes) for caching clean nodes
}

type Database

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

func New

func New(diskdb interface{}, _ interface{}, resolver ChildResolver) *Database

diskdbs, db.cleans, mptResolver{}

func (*Database) Cap

func (this *Database) Cap(limit common.StorageSize) error

func (*Database) Close

func (this *Database) Close() error

func (*Database) Commit

func (this *Database) Commit(hash common.Hash, report bool) error

func (*Database) Dereference

func (this *Database) Dereference(root common.Hash)

func (*Database) Find

func (this *Database) Find(node common.Hash) (*database, []byte, error)

func (*Database) Initialized

func (this *Database) Initialized(genesisRoot common.Hash) bool

func (*Database) Node

func (this *Database) Node(hash common.Hash) ([]byte, error)

func (*Database) Reader

func (this *Database) Reader(blockRoot common.Hash) *paraReader

func (*Database) Reference

func (this *Database) Reference(root common.Hash, parent common.Hash)

func (*Database) Scheme

func (this *Database) Scheme() string

func (*Database) Size

func (this *Database) Size() common.StorageSize

func (*Database) Update

func (this *Database) Update(root common.Hash, parent common.Hash, nodes *trienode.MergedNodeSet) error

Jump to

Keyboard shortcuts

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