db

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: GPL-3.0 Imports: 12 Imported by: 42

Documentation

Overview

Package db defines a persistent backend for the slasher service.

Index

Constants

This section is empty.

Variables

View Source
var DatabaseCommands = &cli.Command{
	Name:     "db",
	Category: "db",
	Usage:    "defines commands for interacting with the Prysm slasher database",
	Subcommands: []*cli.Command{
		{
			Name:        "restore",
			Description: `restores a database from a backup file`,
			Flags: cmd.WrapFlags([]cli.Flag{
				cmd.RestoreSourceFileFlag,
				cmd.RestoreTargetDirFlag,
			}),
			Before: tos.VerifyTosAcceptedOrPrompt,
			Action: func(cliCtx *cli.Context) error {
				if err := restore(cliCtx); err != nil {
					log.Fatalf("Could not restore database: %v", err)
				}
				return nil
			},
		},
	},
}

DatabaseCommands for Prysm slasher.

Functions

func NewDB

func NewDB(dirPath string, cfg *kv.Config) (*kv.Store, error)

NewDB initializes a new DB.

Types

type Database added in v0.3.2

type Database = iface.Database

Database defines the necessary methods for the Slasher's DB 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.

type FullAccessDatabase added in v0.3.2

type FullAccessDatabase = iface.FullAccessDatabase

FullAccessDatabase exposes Slasher's DB write and read functions for all slasher related buckets.

type ReadOnlyDatabase added in v0.3.2

type ReadOnlyDatabase = iface.ReadOnlyDatabase

ReadOnlyDatabase exposes the Slasher's DB read only functions for all slasher related buckets.

type WriteAccessDatabase added in v0.3.2

type WriteAccessDatabase = iface.WriteAccessDatabase

WriteAccessDatabase exposes the Slasher's DB writing functions for all slasher related buckets.

Directories

Path Synopsis
Package iface defines an interface for the slasher database, providing more advanced interfaces such as a ReadOnlyDatabase.
Package iface defines an interface for the slasher database, providing more advanced interfaces such as a ReadOnlyDatabase.
Package kv defines a bolt-db, key-value store implementation of the slasher database interface.
Package kv defines a bolt-db, key-value store implementation of the slasher database interface.
Package testing defines useful helper functions for unit tests with the slasher database.
Package testing defines useful helper functions for unit tests with the slasher database.
Package types includes important database-related types for slasher-specific logic.
Package types includes important database-related types for slasher-specific logic.

Jump to

Keyboard shortcuts

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