appdb

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppDB

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

AppDB is responsible for storing basic information about app state on disk

func NewAppDB

func NewAppDB(cfg *config.Config) *AppDB

NewAppDB creates AppDB instance with given config

func (*AppDB) Close

func (appDB *AppDB) Close()

Close closes db connection, panics on error

func (*AppDB) GetLastBlockHash

func (appDB *AppDB) GetLastBlockHash() []byte

GetLastBlockHash returns latest block hash stored on disk

func (*AppDB) GetLastBlocksTimeDelta added in v0.9.0

func (appDB *AppDB) GetLastBlocksTimeDelta(height uint64) (int, error)

GetLastBlocksTimeDelta returns delta of time between latest blocks

func (*AppDB) GetLastHeight

func (appDB *AppDB) GetLastHeight() uint64

GetLastHeight returns latest block height stored on disk

func (*AppDB) GetStartHeight added in v0.16.0

func (appDB *AppDB) GetStartHeight() uint64

GetStartHeight returns start height stored on disk

func (*AppDB) GetValidators

func (appDB *AppDB) GetValidators() types.ValidatorUpdates

GetValidators returns list of latest validators stored on dist

func (*AppDB) SaveValidators

func (appDB *AppDB) SaveValidators(vals types.ValidatorUpdates)

SaveValidators stores given validators list on disk, panics on error

func (*AppDB) SetLastBlockHash

func (appDB *AppDB) SetLastBlockHash(hash []byte)

SetLastBlockHash stores given block hash on disk, panics on error

func (*AppDB) SetLastBlocksTimeDelta added in v0.9.0

func (appDB *AppDB) SetLastBlocksTimeDelta(height uint64, delta int)

SetLastBlocksTimeDelta stores delta of time between latest blocks

func (*AppDB) SetLastHeight

func (appDB *AppDB) SetLastHeight(height uint64)

SetLastHeight stores given block height on disk, panics on error

func (*AppDB) SetStartHeight added in v0.16.0

func (appDB *AppDB) SetStartHeight(height uint64)

SetStartHeight stores given block height on disk as start height, panics on error

Jump to

Keyboard shortcuts

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