persister

package
v0.38.4 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: AGPL-3.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader added in v0.38.4

func NewReader(db *badger.DB, chainID flow.ChainID) (hotstuff.PersisterReader, error)

NewReader returns a new Persister as a PersisterReader type (only read methods accessible).

Types

type Persister

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

Persister is responsible for persisting minimal critical safety and liveness data for HotStuff: specifically hotstuff.LivenessData and hotstuff.SafetyData.

Persister depends on protocol.State and cluster.State bootstrapping to set initial values for SafetyData and LivenessData, for each distinct chain ID. This bootstrapping must be complete before constructing a Persister instance with New (otherwise it will return an error).

func New

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

New creates a new Persister.

Persister depends on protocol.State and cluster.State bootstrapping to set initial values for SafetyData and LivenessData, for each distinct chain ID. This bootstrapping must be completed before first using a Persister instance.

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