forked from mosaicnetworks/babble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.go
38 lines (36 loc) · 1.07 KB
/
store.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package hashgraph
import "github.com/mosaicnetworks/babble/src/peers"
// Store ...
type Store interface {
CacheSize() int
GetPeerSet(int) (*peers.PeerSet, error)
SetPeerSet(int, *peers.PeerSet) error
GetAllPeerSets() (map[int][]*peers.Peer, error)
FirstRound(uint32) (int, bool)
RepertoireByPubKey() map[string]*peers.Peer
RepertoireByID() map[uint32]*peers.Peer
GetEvent(string) (*Event, error)
SetEvent(*Event) error
ParticipantEvents(string, int) ([]string, error)
ParticipantEvent(string, int) (string, error)
LastEventFrom(string) (string, error)
LastConsensusEventFrom(string) (string, error)
KnownEvents() map[uint32]int
ConsensusEvents() []string
ConsensusEventsCount() int
AddConsensusEvent(*Event) error
GetRound(int) (*RoundInfo, error)
SetRound(int, *RoundInfo) error
LastRound() int
RoundWitnesses(int) []string
RoundEvents(int) int
GetRoot(string) (*Root, error)
GetBlock(int) (*Block, error)
SetBlock(*Block) error
LastBlockIndex() int
GetFrame(int) (*Frame, error)
SetFrame(*Frame) error
Reset(*Frame) error
Close() error
StorePath() string
}