forked from onflow/flow-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
persister.go
23 lines (19 loc) · 907 Bytes
/
persister.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package hotstuff
// Persister is responsible for persisting state we need to bootstrap after a
// restart or crash.
type Persister interface {
// GetSafetyData will retrieve last persisted safety data.
// During normal operations, no errors are expected.
GetSafetyData() (*SafetyData, error)
// PutSafetyData persists the last safety data.
// This method blocks until `safetyData` was successfully persisted.
// During normal operations, no errors are expected.
PutSafetyData(safetyData *SafetyData) error
// GetLivenessData will retrieve last persisted liveness data.
// During normal operations, no errors are expected.
GetLivenessData() (*LivenessData, error)
// PutLivenessData persists the last liveness data.
// This method blocks until `safetyData` was successfully persisted.
// During normal operations, no errors are expected.
PutLivenessData(livenessData *LivenessData) error
}