posdb

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: GPL-3.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbInitAll

func DbInitAll(pathname string)

DbInitAll init all db files

func GetEpochLeaderGroup

func GetEpochLeaderGroup(epochId uint64) [][]byte

func GetRBProposerGroup

func GetRBProposerGroup(epochId uint64) [][]byte

func GetStakerInfoBytes

func GetStakerInfoBytes(epochId uint64, addr common.Address) []byte

Types

type Db

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

Db is the wanpos leveldb class

func GetDb

func GetDb() *Db

GetDb can get a Db instance to use

func GetDbByName

func GetDbByName(name string) *Db

func NewDb

func NewDb(fileName string) *Db

func (*Db) DbClose

func (s *Db) DbClose()

DbClose use to close db file

func (*Db) DbInit

func (s *Db) DbInit(dbPath string)

DbInit use to init leveldb in this object, user should not use this. It is automate called in init().

func (*Db) Get

func (s *Db) Get(epochID uint64, key string) ([]byte, error)

Get use to get a key-value store with a given epochID

func (*Db) GetStorageByteArray

func (s *Db) GetStorageByteArray(epochID uint64) [][]byte

GetStorageByteArray : cb is callback function. cb return true indicating like to continue, return false indicating stop

func (*Db) GetWithIndex

func (s *Db) GetWithIndex(epochID uint64, index uint64, key string) ([]byte, error)

GetWithIndex use to get a key-value store with a given epochID and Index

func (*Db) Put

func (s *Db) Put(epochID uint64, key string, value []byte) ([]byte, error)

Put use to set a key-value store with a given epochID

func (*Db) PutWithIndex

func (s *Db) PutWithIndex(epochID uint64, index uint64, key string, value []byte) ([]byte, error)

PutWithIndex use to set a key-value store with a given epochID and Index

type Proposer

type Proposer struct {
	PubSec256     []byte
	PubBn256      []byte
	Probabilities *big.Int
}

TODO duplicated with epochLeader

Jump to

Keyboard shortcuts

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