persister

package
v0.36.11-previewnet Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: AGPL-3.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Persister

type Persister struct {
	// contains filtered or unexported fields
}

Persister can persist relevant information for hotstuff. Persister depends on protocol.State root snapshot bootstrapping to set initial values for SafetyData and LivenessData. These values must be initialized before first use of Persister.

func New

func New(db *badger.DB, chainID flow.ChainID) *Persister

New creates a new Persister using the injected data base to persist relevant hotstuff data.

func (*Persister) GetLivenessData added in v0.29.0

func (p *Persister) GetLivenessData() (*hotstuff.LivenessData, error)

GetLivenessData will retrieve last persisted liveness data. During normal operations, no errors are expected.

func (*Persister) GetSafetyData added in v0.29.0

func (p *Persister) GetSafetyData() (*hotstuff.SafetyData, error)

GetSafetyData will retrieve last persisted safety data. During normal operations, no errors are expected.

func (*Persister) PutLivenessData added in v0.29.0

func (p *Persister) PutLivenessData(livenessData *hotstuff.LivenessData) error

PutLivenessData persists the last liveness data. During normal operations, no errors are expected.

func (*Persister) PutSafetyData added in v0.29.0

func (p *Persister) PutSafetyData(safetyData *hotstuff.SafetyData) error

PutSafetyData persists the last safety data. During normal operations, no errors are expected.

Jump to

Keyboard shortcuts

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