db

package
v0.0.0-...-80b22ab Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHeight

func GetHeight(d *dvotedb.BadgerDB, key string, def int64) *voctypes.Height

GetHeight fetches a height value from the database corresponding to given key

func GetHeightMap

func GetHeightMap(d *dvotedb.BadgerDB, key string) *voctypes.HeightMap

GetHeightMap fetches a height map from the database

func GetInt64

func GetInt64(d *dvotedb.BadgerDB, key string) int64

GetInt64 fetches a int64 value from the database corresponding to given key

func ListItemsByHeight

func ListItemsByHeight(d *dvotedb.BadgerDB, max, height int, prefix []byte) [][]byte

ListItemsByHeight returns a list of items given integer keys

func SearchBlocksByValidator

func SearchBlocksByValidator(d *dvotedb.BadgerDB, max int, term, validator string) [][]byte

SearchBlocksByValidator returns a list of blocks given the search term and validator

func SearchItems

func SearchItems(d *dvotedb.BadgerDB, max int, term string, prefix []byte) [][]byte

SearchItems returns a list of items given search term, starting with given prefix

func SearchKeys

func SearchKeys(d *dvotedb.BadgerDB, max int, term string, prefix []byte) [][]byte

SearchKeys returns a list of key values including the search term, starting with the given prefix

Types

type BlockState

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

type ExplorerDB

type ExplorerDB struct {
	Db *dvotedb.BadgerDB
	Vs *vochain.VochainService
}

func NewDB

func NewDB(cfg *config.MainCfg) *ExplorerDB

NewDB initializes a badger database at the given path

func (*ExplorerDB) Close

func (d *ExplorerDB) Close()

Close closes the explorer db

func (*ExplorerDB) UpdateDB

func (d *ExplorerDB) UpdateDB()

UpdateDB continuously updates the database by calling dvote & tendermint apis

Jump to

Keyboard shortcuts

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