cache

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachManager

func AttachManager(database db.Database, dir string, mem, file int) db.Database

AttachManager attach cache manager to the database, and return it. dir is root directory for storing files for cache. mem is number of levels of tree items to store in the memory. file is number of levels of tree items to store in files.

func EnableAccountNodeCacheByForce added in v0.9.7

func EnableAccountNodeCacheByForce(database db.Database, id []byte) bool

EnableAccountNodeCacheByForce enable AccountNodeCache ignoring default setting. Default setting for account node cache is specified by call in AttachManager.

Types

type NodeCache

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

func AccountNodeCacheOf

func AccountNodeCacheOf(database db.Database, id []byte) *NodeCache

AccountNodeCacheOf get node cache of the account specified by *id*. If node cache for the account is not enabled, it returns nil.

func NewNodeCache

func NewNodeCache(depth int, fdepth int, path string) *NodeCache

func WorldNodeCacheOf

func WorldNodeCacheOf(database db.Database) *NodeCache

WorldNodeCacheOf get node cache of the world if it has. If node cache for world state is not enabled, it returns nil.

func (*NodeCache) Get

func (c *NodeCache) Get(nibs []byte, h []byte) ([]byte, bool)

func (*NodeCache) Put

func (c *NodeCache) Put(nibs []byte, h []byte, serialized []byte)

Jump to

Keyboard shortcuts

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