Documentation
¶
Overview ¶
Package storage implements an interface to a goleveldb database.
Index ¶
- type Database
- func (db *Database) Close()
- func (db *Database) FinalizeHeight(height int64)
- func (db *Database) Get(key []byte) []byte
- func (db *Database) GetBlockCredentials(height int64) []*commands.CredentialPair
- func (db *Database) GetCredential(height int64, gammaB []byte) *commands.CredentialPair
- func (db *Database) GetHighest() int64
- func (db *Database) Set(key []byte, value []byte)
- func (db *Database) StoreIssuedSignature(height int64, gammaB []byte, cred utils.IssuedSignature)
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 (*Database) Close ¶
func (db *Database) Close()
Close closes the database connection. It should be called upon server shutdown.
func (*Database) FinalizeHeight ¶
FinalizeHeight increases the height of the latest processed block.
func (*Database) Get ¶
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 ¶
GetHighest obtains the height of the latest stored block. It's required on server restart.
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]