mpt

package
v0.0.0-...-0abe6a2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disable log

func New

func New(cfg *types.Store, sub []byte) queue.Module

New new mpt store module

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel set log level

Types

type Store

type Store struct {
	*drivers.BaseStore
	// contains filtered or unexported fields
}

Store mpt store struct

func (*Store) Close

func (mpts *Store) Close()

Close close mpt store

func (*Store) Commit

func (mpts *Store) Commit(req *types.ReqHash) ([]byte, error)

Commit convert memcory mpt to storage db

func (*Store) CommitUpgrade

func (mpts *Store) CommitUpgrade(req *types.ReqHash) ([]byte, error)

CommitUpgrade convert memcory mpt to storage db

func (*Store) Del

func (mpts *Store) Del(req *types.StoreDel) ([]byte, error)

Del ...

func (*Store) Get

func (mpts *Store) Get(datas *types.StoreGet) [][]byte

Get get values by keys

func (*Store) IterateRangeByStateHash

func (mpts *Store) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, fn func(key, value []byte) bool)

IterateRangeByStateHash 迭代实现功能; statehash:当前状态hash, start:开始查找的key, end: 结束的key, ascending:升序,降序, fn 迭代回调函数

func (*Store) MemSet

func (mpts *Store) MemSet(datas *types.StoreSet, sync bool) ([]byte, error)

MemSet set keys values to memcory mpt, return root hash and error

func (*Store) MemSetUpgrade

func (mpts *Store) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error)

MemSetUpgrade set keys values to memcory mpt, return root hash and error

func (*Store) ProcEvent

func (mpts *Store) ProcEvent(msg *queue.Message)

ProcEvent not support message

func (*Store) Rollback

func (mpts *Store) Rollback(req *types.ReqHash) ([]byte, error)

Rollback 回退将缓存的mpt树删除掉

func (*Store) Set

func (mpts *Store) Set(datas *types.StoreSet, sync bool) ([]byte, error)

Set set k v to mpt store db; sync is true represent write sync

Directories

Path Synopsis
Package mpt implements Merkle Patricia Tries.
Package mpt implements Merkle Patricia Tries.
db2
Package mpt implements Merkle Patricia Tries.
Package mpt implements Merkle Patricia Tries.
rlp
Package rlp implements the RLP serialization format.
Package rlp implements the RLP serialization format.

Jump to

Keyboard shortcuts

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