store

package
v0.0.0-...-3c905e5 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: BSD-3-Clause Imports: 7 Imported by: 4

Documentation

Overview

Package store store the world - state data

Index

Constants

This section is empty.

Variables

View Source
var EmptyRoot [32]byte

EmptyRoot mavl树空的根hash

Functions

func DisableLog

func DisableLog()

DisableLog disable log

func Reg

func Reg(name string, create Storecreate)

Reg 注册 store driver

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel set log level

Types

type BaseStore

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

BaseStore 基础的store结构体

func NewBaseStore

func NewBaseStore(cfg *types.Store) *BaseStore

NewBaseStore new base store struct

func (*BaseStore) Close

func (store *BaseStore) Close()

Close 关闭BaseStore 相关资源包括数据库、client等

func (*BaseStore) GetDB

func (store *BaseStore) GetDB() dbm.DB

GetDB 返回 store db

func (*BaseStore) GetQueueClient

func (store *BaseStore) GetQueueClient() queue.Client

GetQueueClient 返回store模块的client

func (*BaseStore) SetChild

func (store *BaseStore) SetChild(sub SubStore)

SetChild 设置BaseStore中的子存储参数

func (*BaseStore) SetQueueClient

func (store *BaseStore) SetQueueClient(c queue.Client)

SetQueueClient set client queue for recv msg

func (*BaseStore) Wait

func (store *BaseStore) Wait()

Wait wait for basestore ready

type Storecreate

type Storecreate func(cfg *types.Store, sub []byte, chaincfg *types.ChainConfig) queue.Module

Storecreate store queue module

func Load

func Load(name string) (create Storecreate, err error)

Load load StoreCreate by name

type StorelistQuery

type StorelistQuery struct {
	*types.StoreListReply
	// contains filtered or unexported fields
}

StorelistQuery defines a type store list query

func NewStoreListQuery

func NewStoreListQuery(store SubStore, req *types.StoreList) *StorelistQuery

NewStoreListQuery new store list query object

func (*StorelistQuery) IterateCallBack

func (t *StorelistQuery) IterateCallBack(key, value []byte) bool

IterateCallBack store list query iterate callback

func (*StorelistQuery) Run

Run store list query

type SubStore

type SubStore interface {
	Set(datas *types.StoreSet, sync bool) ([]byte, error)
	Get(datas *types.StoreGet) [][]byte
	MemSet(datas *types.StoreSet, sync bool) ([]byte, error)
	Commit(hash *types.ReqHash) ([]byte, error)
	Rollback(req *types.ReqHash) ([]byte, error)
	Del(req *types.StoreDel) ([]byte, error)
	IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, fn func(key, value []byte) bool)
	ProcEvent(msg *queue.Message)

	//用升级本地交易构建store
	MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error)
	CommitUpgrade(hash *types.ReqHash) ([]byte, error)
}

SubStore store db的操作接口

Directories

Path Synopsis
Package init 初始化系统store包
Package init 初始化系统store包
Package mavl 默克尔平衡树接口
Package mavl 默克尔平衡树接口
db
Package mavl 默克尔平衡树算法实现以及裁剪
Package mavl 默克尔平衡树算法实现以及裁剪
db/tool
package main 用于测试数据库中的MAVL节点数目
package main 用于测试数据库中的MAVL节点数目

Jump to

Keyboard shortcuts

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