db

package
v3.2.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: GPL-3.0 Imports: 12 Imported by: 29

Documentation

Overview

Package db defines the ability to create a new database for an Ethereum Beacon Node.

Index

Constants

This section is empty.

Variables

View Source
var ErrExistingGenesisState = iface.ErrExistingGenesisState

ErrExistingGenesisState is an error when the user attempts to save a different genesis state when one already exists in a database.

View Source
var ErrNotFound = kv.ErrNotFound

ErrNotFound can be used to determine if an error from a method in the database package represents a "not found" error. These often require different handling than a low-level i/o error. This variable copies the value in the kv package to the same scope as the Database interfaces, so that it is available to code paths that do not interact directly with the kv package.

View Source
var ErrNotFoundBackfillBlockRoot = kv.ErrNotFoundBackfillBlockRoot

ErrNotFoundBackfillBlockRoot wraps ErrNotFound for an error specific to the backfill block root.

View Source
var ErrNotFoundGenesisBlockRoot = kv.ErrNotFoundGenesisBlockRoot

ErrNotFoundGenesisBlockRoot means no genesis block root was found, indicating the db was not initialized with genesis

View Source
var ErrNotFoundOriginBlockRoot = kv.ErrNotFoundOriginBlockRoot

ErrNotFoundOriginBlockRoot wraps ErrNotFound for an error specific to the origin block root.

View Source
var ErrNotFoundState = kv.ErrNotFoundState

ErrNotFoundState wraps ErrNotFound for an error specific to a state not being found in the database.

Functions

func NewDBFilename

func NewDBFilename(dirPath string) string

NewDBFilename uses the KVStoreDatafilePath so that if this layer of indirection between db.NewDB->kv.NewKVStore ever changes, it will be easy to remember to also change this filename indirection at the same time.

func Restore

func Restore(cliCtx *cli.Context) error

Restore a beacon chain database.

Types

type Database

type Database = iface.Database

Database defines the necessary methods for Prysm's Ethereum backend which may be implemented by any key-value or relational database in practice. This is the full database interface which should not be used often. Prefer a more restrictive interface in this package.

func NewDB

func NewDB(ctx context.Context, dirPath string) (Database, error)

NewDB initializes a new DB.

type HeadAccessDatabase

type HeadAccessDatabase = iface.HeadAccessDatabase

HeadAccessDatabase exposes Prysm's Ethereum backend for read/write access with information about chain head information. This interface should be used sparingly as the HeadFetcher is the source of truth around chain head information while this interface serves as persistent storage for the head fetcher.

See github.com/prysmaticlabs/prysm/blockchain.HeadFetcher

type NoHeadAccessDatabase

type NoHeadAccessDatabase = iface.NoHeadAccessDatabase

NoHeadAccessDatabase exposes Prysm's Ethereum data backend for read/write access, no information about head info. For head info, use github.com/prysmaticlabs/prysm/blockchain.HeadFetcher.

type ReadOnlyDatabase

type ReadOnlyDatabase = iface.ReadOnlyDatabase

ReadOnlyDatabase exposes Prysm's Ethereum data backend for read access only, no information about head info. For head info, use github.com/prysmaticlabs/prysm/blockchain.HeadFetcher.

type SlasherDatabase

type SlasherDatabase = iface.SlasherDatabase

SlasherDatabase defines necessary methods for Prysm's slasher implementation.

Directories

Path Synopsis
Package filters specifies utilities for building a set of data attribute filters to be used when filtering data through database queries in practice.
Package filters specifies utilities for building a set of data attribute filters to be used when filtering data through database queries in practice.
Package iface defines the actual database interface used by a Prysm beacon node, also containing useful, scoped interfaces such as a ReadOnlyDatabase.
Package iface defines the actual database interface used by a Prysm beacon node, also containing useful, scoped interfaces such as a ReadOnlyDatabase.
Package kv defines a bolt-db, key-value store implementation of the Database interface defined by a Prysm beacon node.
Package kv defines a bolt-db, key-value store implementation of the Database interface defined by a Prysm beacon node.
Package slasherkv defines a bolt-db, key-value store implementation of the slasher database interface for Prysm.
Package slasherkv defines a bolt-db, key-value store implementation of the slasher database interface for Prysm.
Package testing allows for spinning up a real bolt-db instance for unit tests throughout the Prysm repo.
Package testing allows for spinning up a real bolt-db instance for unit tests throughout the Prysm repo.

Jump to

Keyboard shortcuts

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