storage

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package storage implements an interface to a goleveldb database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database represents all data required to interact with the storage.

func New

func New(name string, dir string) (*Database, error)

New returns new instance of a database.

func (*Database) Close

func (db *Database) Close()

Close closes the database connection. It should be called upon server shutdown.

func (*Database) FinalizeHeight

func (db *Database) FinalizeHeight(height int64)

FinalizeHeight increases the height of the latest processed block.

func (*Database) Get

func (db *Database) Get(key []byte) []byte

Get gets the value corresponding to particular key. Returns nil if it doesn't exist.

func (*Database) GetBlockCredentials

func (db *Database) GetBlockCredentials(height int64) []*commands.CredentialPair

GetBlockCredentials gets all blinded signatures for given block height.

func (*Database) GetCredential

func (db *Database) GetCredential(height int64, gammaB []byte) *commands.CredentialPair

GetCredential gets credential at given height that used particular gamma.

func (*Database) GetHighest

func (db *Database) GetHighest() int64

GetHighest obtains the height of the latest stored block. It's required on server restart.

func (*Database) Set

func (db *Database) Set(key []byte, value []byte)

Set sets particular key value pair.

func (*Database) StoreIssuedSignature

func (db *Database) StoreIssuedSignature(height int64, gammaB []byte, cred utils.IssuedSignature)

StoreIssuedSignature stores particular blinded signature using appropriate key. [CREDENTIAL_PREFIX || BLOCK_HEIGHT || GAMMA] --- [uint64ID || BLINDED_SIGNATURE]

Jump to

Keyboard shortcuts

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