database

package
v0.0.0-...-cdf0fd8 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builder

func Builder(cfg types.DatabaseConfig, encodingConfig *params.EncodingConfig) (db.Database, error)

Builder creates a database connection with the given database connection info from config. It returns a database connection handle or an error if the connection fails.

Types

type Database

type Database struct {
	Sql            *sql.DB
	EncodingConfig *params.EncodingConfig
	Logger         logging.Logger
}

Database defines a wrapper around a SQL database and implements functionality for data aggregation and exporting.

func (*Database) Close

func (db *Database) Close()

Close implements db.Database

func (*Database) GetLastPruned

func (db *Database) GetLastPruned() (int64, error)

GetLastPruned implements db.PruningDb

func (*Database) HasBlock

func (db *Database) HasBlock(height int64) (bool, error)

HasBlock implements db.Database

func (*Database) HasValidator

func (db *Database) HasValidator(addr string) (bool, error)

HasValidator implements db.Database

func (*Database) LastBlockHeight

func (db *Database) LastBlockHeight() (int64, error)

LastBlockHeight implements db.Database

func (*Database) Prune

func (db *Database) Prune(height int64) error

Prune implements db.PruningDb

func (*Database) SaveBlock

func (db *Database) SaveBlock(block []types.Block) error

func (*Database) SaveCollection

func (db *Database) SaveCollection(collection []types.Collection) error

func (*Database) SaveCommitSignatures

func (db *Database) SaveCommitSignatures(signatures []*types.CommitSig) error

SaveCommitSignatures implements db.Database

func (*Database) SaveEvents

func (db *Database) SaveEvents(events []types.Event) error

func (*Database) SaveTransactionResult

func (db *Database) SaveTransactionResult(transactionResult []types.TransactionResult, height uint64) error

func (*Database) SaveTxs

func (db *Database) SaveTxs(transaction types.Txs) error

func (*Database) SaveValidators

func (db *Database) SaveValidators(validators []*types.Validator) error

SaveValidators implements db.Database

func (*Database) StoreLastPruned

func (db *Database) StoreLastPruned(height int64) error

StoreLastPruned implements db.PruningDb

Jump to

Keyboard shortcuts

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