Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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.