clientdb

package
Version: v0.0.0-...-f5f0bdb Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBConfigType = "disk" // other option is "memory"

DBConfigType ...

View Source
var DBPathPrefix = "database"

DBPathPrefix ...

View Source
var DefaultPath = "~/.golkadot"

DefaultPath ...

View Source
var DefaultType = "disk"

DefaultType ...

Functions

func CreateMethod

func CreateMethod(method string, key string, meta SubstrateMetadata) types.StorageFunction

CreateMethod is small helper function to factorize code on this page

func KeyBestHash

func KeyBestHash() types.StorageFunction

KeyBestHash ...

func KeyBestNumber

func KeyBestNumber() types.StorageFunction

KeyBestNumber ...

func KeyBlockByHash

func KeyBlockByHash() types.StorageFunction

KeyBlockByHash ...

func KeyHashByNumber

func KeyHashByNumber() types.StorageFunction

KeyHashByNumber ...

func KeyHeaderByHash

func KeyHeaderByHash() types.StorageFunction

KeyHeaderByHash ...

Types

type Base

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

Base ...

func NewBase

func NewBase(dbs db.BaseDB) *Base

NewBase ...

func (*Base) Del

func (b *Base) Del(key []uint8)

Del ...

func (*Base) Get

func (b *Base) Get(key []uint8) []uint8

Get ...

func (*Base) OnUpdate

func (b *Base) OnUpdate(subscriber func(value []uint8))

OnUpdate ...

func (*Base) Set

func (b *Base) Set(key []uint8, value []uint8) []uint8

Set ...

type BlockDB

type BlockDB struct {
	DB         db.BaseDB
	BestHash   StorageMethodU8a
	BestNumber StorageMethodBn
	BlockData  StorageMethodU8a
	Hash       StorageMethodU8a
	Header     StorageMethodU8a
}

BlockDB ...

func NewBlockDB

func NewBlockDB(dbs db.BaseDB) *BlockDB

NewBlockDB ...

type Config

type Config struct {
	Compact  bool
	IsTrieDb bool
	Path     string
	Snapshot bool
	Type     string // DBConfigType
}

Config ...

type DB

type DB struct {
	BlocksDB *BlockDB
	StateDB  *StateDB
	BasePath string
	Config   *clientdbtypes.Config
}

DB ...

func NewDB

func NewDB(config *clienttypes.ConfigClient, chain *clientchainloader.Loader) *DB

NewDB ...

func (*DB) Blocks

func (c *DB) Blocks() *BlockDB

Blocks ...

func (*DB) Snapshot

func (c *DB) Snapshot()

Snapshot ...

func (*DB) State

func (c *DB) State() *StateDB

State ...

type InterfaceChainDbs

type InterfaceChainDbs interface {
	Snapshot()
}

InterfaceChainDbs ...

type MetadataType

type MetadataType struct {
	Key   string
	Value string
}

MetadataType ...

type StateDB

type StateDB struct {
	DB   *triedb.TrieDB
	Code *StorageMethodU8a
}

StateDB ...

type StorageMethodBn

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

StorageMethodBn ...

func NewStorageMethodBn

func NewStorageMethodBn(dbs db.BaseDB, createKey types.StorageFunction, bitLen int) StorageMethodBn

NewStorageMethodBn ...

func (*StorageMethodBn) Del

func (s *StorageMethodBn) Del(keyParams ...interface{})

Del ...

func (*StorageMethodBn) Get

func (s *StorageMethodBn) Get(keyParams ...interface{}) *big.Int

Get ...

func (*StorageMethodBn) OnUpdate

func (s *StorageMethodBn) OnUpdate(callback func(value []uint8))

OnUpdate ...

func (*StorageMethodBn) Set

func (s *StorageMethodBn) Set(value *big.Int, keyParams ...interface{})

Set ...

type StorageMethodU8a

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

StorageMethodU8a ...

func NewStorageMethodU8a

func NewStorageMethodU8a(dbs db.BaseDB, createKey types.StorageFunction) StorageMethodU8a

NewStorageMethodU8a ...

func (*StorageMethodU8a) Del

func (s *StorageMethodU8a) Del(keyParam interface{})

Del ...

func (*StorageMethodU8a) Get

func (s *StorageMethodU8a) Get(keyParam interface{}) []uint8

Get ...

func (*StorageMethodU8a) OnUpdate

func (s *StorageMethodU8a) OnUpdate(callback func(value []uint8))

OnUpdate ...

func (*StorageMethodU8a) Set

func (s *StorageMethodU8a) Set(value []uint8, keyParam interface{})

Set ...

type SubstrateMetadata

type SubstrateMetadata struct {
	Documentation []string
	Type          MetadataType
}

SubstrateMetadata ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL