types

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PruningOptionDefault    = "default"
	PruningOptionEverything = "everything"
	PruningOptionNothing    = "nothing"
	PruningOptionCustom     = "custom"
)

Pruning option string constants

Variables

View Source
var (
	ErrPruningIntervalZero       = errors.New("'pruning-interval' must not be 0. If you want to disable pruning, select pruning = \"nothing\"")
	ErrPruningIntervalTooSmall   = fmt.Errorf("'pruning-interval' must not be less than %d. For the most aggressive pruning, select pruning = \"everything\"", pruneEverythingInterval)
	ErrPruningKeepRecentTooSmall = fmt.Errorf("'pruning-keep-recent' must not be less than %d. For the most aggressive pruning, select pruning = \"everything\"", pruneEverythingKeepRecent)
)

Functions

This section is empty.

Types

type PruningOptions

type PruningOptions struct {
	// KeepRecent defines how many recent heights to keep on disk.
	KeepRecent uint64

	// Interval defines when the pruned heights are removed from disk.
	Interval uint64

	// Strategy defines the kind of pruning strategy. See below for more information on each.
	Strategy PruningStrategy
}

PruningOptions defines the pruning strategy used when determining which heights are removed from disk when committing state.

func NewCustomPruningOptions

func NewCustomPruningOptions(keepRecent, interval uint64) PruningOptions

func NewPruningOptions

func NewPruningOptions(pruningStrategy PruningStrategy) PruningOptions

func NewPruningOptionsFromString

func NewPruningOptionsFromString(strategy string) PruningOptions

func (PruningOptions) GetPruningStrategy

func (po PruningOptions) GetPruningStrategy() PruningStrategy

func (PruningOptions) Validate

func (po PruningOptions) Validate() error

type PruningStrategy

type PruningStrategy int
const (
	// PruningDefault defines a pruning strategy where the last 362880 heights are
	// kept where to-be pruned heights are pruned at every 10th height.
	// The last 362880 heights are kept(approximately 3.5 weeks worth of state) assuming the typical
	// block time is 6s. If these values do not match the applications' requirements, use the "custom" option.
	PruningDefault PruningStrategy = iota
	// PruningEverything defines a pruning strategy where all committed heights are
	// deleted, storing only the current height and last 2 states. To-be pruned heights are
	// pruned at every 10th height.
	PruningEverything
	// PruningNothing defines a pruning strategy where all heights are kept on disk.
	// This is the only stretegy where KeepEvery=1 is allowed with state-sync snapshots disabled.
	PruningNothing
	// PruningCustom defines a pruning strategy where the user specifies the pruning.
	PruningCustom
	// PruningUndefined defines an undefined pruning strategy. It is to be returned by stores that do not support pruning.
	PruningUndefined
)

Jump to

Keyboard shortcuts

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