badger

package
v0.2103.5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package badger provides a Badger-backed node database.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrVersionNotFound can be returned by the migration helper when the
	// relevant version can't be found in the history database.
	ErrVersionNotFound = fmt.Errorf("version not found")
)

Functions

func CheckSanity added in v0.2100.0

func CheckSanity(ctx context.Context, cfg *api.Config, display DisplayHelper) error

CheckSanity checks the sanity of the node database by traversing all stored trees.

func Migrate added in v0.2100.0

func Migrate(cfg *api.Config, helper MigrationHelper) (uint64, error)

Migrate performs forward migrations between database versions.

func New

func New(cfg *api.Config) (api.NodeDB, error)

New creates a new BadgerDB-backed node database.

func RenameNamespace added in v0.2101.2

func RenameNamespace(cfg *api.Config, newNamespace common.Namespace) error

RenameNamespace changes the namespace specified in the database.

Types

type DisplayHelper added in v0.2100.0

type DisplayHelper interface {
	Display(msg string)
	DisplayStepBegin(msg string)
	DisplayStepEnd(msg string)
	DisplayStep(msg string)
	DisplayProgress(msg string, current, total uint64)
}

type MigrationHelper added in v0.2100.0

type MigrationHelper interface {
	DisplayHelper
	GetRootForHash(root hash.Hash, version uint64) ([]node.Root, error)
}

Jump to

Keyboard shortcuts

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