Documentation ¶
Index ¶
- Constants
- Variables
- func BlockSignatureListEquals(this []*BlockSignature, that []*BlockSignature) bool
- func EqualsMapStringRootEvent(this map[string]*RootEvent, that map[string]*RootEvent) bool
- func EqualsMapStringRoundEvent(this map[string]*RoundEvent, that map[string]*RoundEvent) bool
- func EventListEquals(this []*EventMessage, that []*EventMessage) bool
- func InternalTransactionListEquals(this []*wire.InternalTransaction, that []*wire.InternalTransaction) bool
- func ListBytesEquals(this [][]byte, that [][]byte) bool
- func MapStringsEquals(this map[string]string, that map[string]string) bool
- func RootListEquals(this []*Root, that []*Root) bool
- type BadgerStore
- func LoadBadgerStore(cacheSize int, path string) (*BadgerStore, error)
- func LoadOrCreateBadgerStore(participants *peers.Peers, cacheSize int, path string, posConf *pos.Config) (*BadgerStore, error)
- func NewBadgerStore(participants *peers.Peers, cacheSize int, path string, posConf *pos.Config) (*BadgerStore, error)
- func (s *BadgerStore) AddConsensusEvent(event Event) error
- func (s *BadgerStore) CacheSize() int
- func (s *BadgerStore) Close() error
- func (s *BadgerStore) ConsensusEvents() EventHashes
- func (s *BadgerStore) ConsensusEventsCount() int64
- func (s *BadgerStore) GetBlock(rr int64) (Block, error)
- func (s *BadgerStore) GetEventBlock(hash EventHash) (event Event, err error)
- func (s *BadgerStore) GetFrame(rr int64) (Frame, error)
- func (s *BadgerStore) GetRoot(participant string) (Root, error)
- func (s *BadgerStore) GetRoundCreated(r int64) (RoundCreated, error)
- func (s *BadgerStore) GetRoundReceived(r int64) (RoundReceived, error)
- func (s *BadgerStore) LastBlockIndex() int64
- func (s *BadgerStore) LastConsensusEventFrom(participant string) (last EventHash, isRoot bool, err error)
- func (s *BadgerStore) LastEventFrom(participant string) (last EventHash, isRoot bool, err error)
- func (s *BadgerStore) LastRound() int64
- func (s *BadgerStore) NeedBootstrap() bool
- func (s *BadgerStore) ParticipantEvent(participant string, index int64) (EventHash, error)
- func (s *BadgerStore) ParticipantEvents(participant string, skip int64) (EventHashes, error)
- func (s *BadgerStore) Participants() (*peers.Peers, error)
- func (s *BadgerStore) Reset(roots map[string]Root) error
- func (s *BadgerStore) RootsByParticipant() map[string]Root
- func (s *BadgerStore) RootsBySelfParent() map[EventHash]Root
- func (s *BadgerStore) RoundClothos(r int64) EventHashes
- func (s *BadgerStore) RoundEvents(r int64) int
- func (s *BadgerStore) SetBlock(block Block) error
- func (s *BadgerStore) SetEvent(event Event) error
- func (s *BadgerStore) SetFrame(frame Frame) error
- func (s *BadgerStore) SetRoundCreated(r int64, round RoundCreated) error
- func (s *BadgerStore) SetRoundReceived(r int64, round RoundReceived) error
- func (s *BadgerStore) StateDB() state.Database
- func (s *BadgerStore) StateRoot() hash.Hash
- func (s *BadgerStore) StorePath() string
- func (s *BadgerStore) TopologicalEvents() ([]Event, error)
- type Block
- func (b *Block) AppendTransactions(txs [][]byte)
- func (b *Block) BlockHash() ([]byte, error)
- func (b *Block) BlockHex() string
- func (*Block) Descriptor() ([]byte, []int)
- func (b *Block) Equals(that *Block) bool
- func (b *Block) GetBlockSignatures() []BlockSignature
- func (m *Block) GetBody() *BlockBody
- func (m *Block) GetCreatedTime() int64
- func (m *Block) GetFrameHash() []byte
- func (m *Block) GetHash() []byte
- func (m *Block) GetHex() string
- func (b *Block) GetSignature(validator string) (res BlockSignature, err error)
- func (m *Block) GetSignatures() map[string]string
- func (m *Block) GetStateHash() []byte
- func (b *Block) Index() int64
- func (b *Block) ProtoMarshal() ([]byte, error)
- func (*Block) ProtoMessage()
- func (b *Block) ProtoUnmarshal(data []byte) error
- func (m *Block) Reset()
- func (b *Block) RoundReceived() int64
- func (b *Block) SetSignature(bs BlockSignature) error
- func (b *Block) Sign(privKey *ecdsa.PrivateKey) (bs BlockSignature, err error)
- func (m *Block) String() string
- func (b *Block) Transactions() [][]byte
- func (b *Block) Verify(sig BlockSignature) (bool, error)
- func (m *Block) XXX_DiscardUnknown()
- func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Block) XXX_Merge(src proto.Message)
- func (m *Block) XXX_Size() int
- func (m *Block) XXX_Unmarshal(b []byte) error
- type BlockBody
- func (*BlockBody) Descriptor() ([]byte, []int)
- func (bb *BlockBody) Equals(that *BlockBody) bool
- func (m *BlockBody) GetIndex() int64
- func (m *BlockBody) GetRoundReceived() int64
- func (m *BlockBody) GetTransactions() [][]byte
- func (bb *BlockBody) Hash() ([]byte, error)
- func (bb *BlockBody) ProtoMarshal() ([]byte, error)
- func (*BlockBody) ProtoMessage()
- func (bb *BlockBody) ProtoUnmarshal(data []byte) error
- func (m *BlockBody) Reset()
- func (m *BlockBody) String() string
- func (m *BlockBody) XXX_DiscardUnknown()
- func (m *BlockBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlockBody) XXX_Merge(src proto.Message)
- func (m *BlockBody) XXX_Size() int
- func (m *BlockBody) XXX_Unmarshal(b []byte) error
- type BlockSignature
- func (*BlockSignature) Descriptor() ([]byte, []int)
- func (bs *BlockSignature) Equals(that *BlockSignature) bool
- func (m *BlockSignature) GetIndex() int64
- func (m *BlockSignature) GetSignature() string
- func (m *BlockSignature) GetValidator() []byte
- func (bs *BlockSignature) ProtoMarshal() ([]byte, error)
- func (*BlockSignature) ProtoMessage()
- func (bs *BlockSignature) ProtoUnmarshal(data []byte) error
- func (m *BlockSignature) Reset()
- func (m *BlockSignature) String() string
- func (bs *BlockSignature) ToWire() WireBlockSignature
- func (bs *BlockSignature) ValidatorHex() string
- func (m *BlockSignature) XXX_DiscardUnknown()
- func (m *BlockSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlockSignature) XXX_Merge(src proto.Message)
- func (m *BlockSignature) XXX_Size() int
- func (m *BlockSignature) XXX_Unmarshal(b []byte) error
- type ByLamportTimestamp
- type ByTopologicalOrder
- type Core
- type Event
- func (e *Event) BlockSignatures() []*BlockSignature
- func (e *Event) CreatorID() uint64
- func (e *Event) GetCreator() string
- func (e *Event) GetFlagTable() (FlagTable, error)
- func (e *Event) GetLamportTimestamp() int64
- func (e *Event) GetRound() int64
- func (e *Event) GetRoundReceived() int64
- func (e *Event) Hash() (hash EventHash)
- func (e *Event) Index() int64
- func (e *Event) InternalTransactions() []*wire.InternalTransaction
- func (e *Event) IsLoaded() bool
- func (e *Event) MergeFlagTable(dst FlagTable) (FlagTable, error)
- func (e *Event) OtherParent() (hash EventHash)
- func (e *Event) OtherParentCreatorID() uint64
- func (e *Event) ProtoMarshal() ([]byte, error)
- func (e *Event) ProtoUnmarshal(data []byte) error
- func (e *Event) ReplaceFlagTable(flagTable FlagTable) (err error)
- func (e *Event) SelfParent() (hash EventHash)
- func (e *Event) SetLamportTimestamp(t int64)
- func (e *Event) SetRound(r int64)
- func (e *Event) SetRoundReceived(rr int64)
- func (e *Event) SetWireInfo(selfParentIndex int64, otherParentCreatorID uint64, otherParentIndex int64, ...)
- func (e *Event) Sign(privKey *ecdsa.PrivateKey) error
- func (e *Event) ToWire() WireEvent
- func (e *Event) Transactions() [][]byte
- func (e *Event) Verify() (bool, error)
- func (e *Event) WireBlockSignatures() []WireBlockSignature
- type EventBody
- func (*EventBody) Descriptor() ([]byte, []int)
- func (e *EventBody) Equals(that *EventBody) bool
- func (m *EventBody) GetBlockSignatures() []*BlockSignature
- func (m *EventBody) GetCreator() []byte
- func (m *EventBody) GetIndex() int64
- func (m *EventBody) GetInternalTransactions() []*wire.InternalTransaction
- func (m *EventBody) GetParents() [][]byte
- func (m *EventBody) GetTransactions() [][]byte
- func (e *EventBody) Hash() (hash EventHash, err error)
- func (e *EventBody) ProtoMarshal() ([]byte, error)
- func (*EventBody) ProtoMessage()
- func (e *EventBody) ProtoUnmarshal(data []byte) error
- func (m *EventBody) Reset()
- func (m *EventBody) String() string
- func (m *EventBody) XXX_DiscardUnknown()
- func (m *EventBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventBody) XXX_Merge(src proto.Message)
- func (m *EventBody) XXX_Size() int
- func (m *EventBody) XXX_Unmarshal(b []byte) error
- type EventHash
- type EventHashes
- type EventMessage
- func (*EventMessage) Descriptor() ([]byte, []int)
- func (m *EventMessage) Equals(that *EventMessage) bool
- func (m *EventMessage) GetBody() *EventBody
- func (m *EventMessage) GetClothoProof() [][]byte
- func (m *EventMessage) GetCreatorID() uint64
- func (m *EventMessage) GetFlagTable() []byte
- func (m *EventMessage) GetHash() []byte
- func (m *EventMessage) GetOtherParentCreatorID() uint64
- func (m *EventMessage) GetOtherParentIndex() int64
- func (m *EventMessage) GetSelfParentIndex() int64
- func (m *EventMessage) GetSignature() string
- func (m *EventMessage) GetTopologicalIndex() int64
- func (*EventMessage) ProtoMessage()
- func (m *EventMessage) Reset()
- func (m *EventMessage) String() string
- func (m *EventMessage) ToEvent() Event
- func (m *EventMessage) XXX_DiscardUnknown()
- func (m *EventMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventMessage) XXX_Merge(src proto.Message)
- func (m *EventMessage) XXX_Size() int
- func (m *EventMessage) XXX_Unmarshal(b []byte) error
- type FlagTable
- type FlagTableWrapper
- func (*FlagTableWrapper) Descriptor() ([]byte, []int)
- func (m *FlagTableWrapper) GetBody() map[string]int64
- func (*FlagTableWrapper) ProtoMessage()
- func (m *FlagTableWrapper) Reset()
- func (m *FlagTableWrapper) String() string
- func (m *FlagTableWrapper) XXX_DiscardUnknown()
- func (m *FlagTableWrapper) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FlagTableWrapper) XXX_Merge(src proto.Message)
- func (m *FlagTableWrapper) XXX_Size() int
- func (m *FlagTableWrapper) XXX_Unmarshal(b []byte) error
- type Frame
- func (*Frame) Descriptor() ([]byte, []int)
- func (f *Frame) Equals(that *Frame) bool
- func (f *Frame) GetEventBlocks() []*EventMessage
- func (m *Frame) GetEvents() []*EventMessage
- func (m *Frame) GetRoots() []*Root
- func (m *Frame) GetRound() int64
- func (m *Frame) GetStateHash() []byte
- func (f *Frame) Hash() ([]byte, error)
- func (f *Frame) ProtoMarshal() ([]byte, error)
- func (*Frame) ProtoMessage()
- func (f *Frame) ProtoUnmarshal(data []byte) error
- func (m *Frame) Reset()
- func (m *Frame) String() string
- func (m *Frame) XXX_DiscardUnknown()
- func (m *Frame) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Frame) XXX_Merge(src proto.Message)
- func (m *Frame) XXX_Size() int
- func (m *Frame) XXX_Unmarshal(b []byte) error
- type InmemStore
- func (s *InmemStore) AddConsensusEvent(event Event) error
- func (s *InmemStore) CacheSize() int
- func (s *InmemStore) Close() error
- func (s *InmemStore) ConsensusEvents() EventHashes
- func (s *InmemStore) ConsensusEventsCount() int64
- func (s *InmemStore) GetBlock(index int64) (Block, error)
- func (s *InmemStore) GetEventBlock(hash EventHash) (Event, error)
- func (s *InmemStore) GetFrame(index int64) (Frame, error)
- func (s *InmemStore) GetRoot(participant string) (Root, error)
- func (s *InmemStore) GetRoundCreated(r int64) (RoundCreated, error)
- func (s *InmemStore) GetRoundReceived(r int64) (RoundReceived, error)
- func (s *InmemStore) LastBlockIndex() int64
- func (s *InmemStore) LastConsensusEventFrom(participant string) (last EventHash, isRoot bool, err error)
- func (s *InmemStore) LastEventFrom(participant string) (last EventHash, isRoot bool, err error)
- func (s *InmemStore) LastRound() int64
- func (s *InmemStore) NeedBootstrap() bool
- func (s *InmemStore) ParticipantEvent(participant string, index int64) (hash EventHash, err error)
- func (s *InmemStore) ParticipantEvents(participant string, skip int64) (EventHashes, error)
- func (s *InmemStore) Participants() (*peers.Peers, error)
- func (s *InmemStore) Reset(roots map[string]Root) error
- func (s *InmemStore) RootsByParticipant() map[string]Root
- func (s *InmemStore) RootsBySelfParent() map[EventHash]Root
- func (s *InmemStore) RoundClothos(r int64) EventHashes
- func (s *InmemStore) RoundEvents(r int64) int
- func (s *InmemStore) SetBlock(block Block) error
- func (s *InmemStore) SetEvent(event Event) error
- func (s *InmemStore) SetFrame(frame Frame) error
- func (s *InmemStore) SetRoundCreated(r int64, round RoundCreated) error
- func (s *InmemStore) SetRoundReceived(r int64, round RoundReceived) error
- func (s *InmemStore) StateDB() state.Database
- func (s *InmemStore) StateRoot() hash.Hash
- func (s *InmemStore) StorePath() string
- func (s *InmemStore) TopologicalEvents() ([]Event, error)
- type Key
- type ParentRoundInfo
- type ParticipantBlockSignaturesCache
- func (psc *ParticipantBlockSignaturesCache) Get(participant string, skipIndex int64) ([]BlockSignature, error)
- func (psc *ParticipantBlockSignaturesCache) GetItem(participant string, index int64) (BlockSignature, error)
- func (psc *ParticipantBlockSignaturesCache) GetLast(participant string) (BlockSignature, error)
- func (psc *ParticipantBlockSignaturesCache) Known() map[uint64]int64
- func (psc *ParticipantBlockSignaturesCache) Reset() error
- func (psc *ParticipantBlockSignaturesCache) Set(participant string, sig BlockSignature) error
- type ParticipantEventsCache
- func (pec *ParticipantEventsCache) AddPeer(peer *peers.Peer) error
- func (pec *ParticipantEventsCache) Get(participant string, skipIndex int64) (EventHashes, error)
- func (pec *ParticipantEventsCache) GetItem(participant string, index int64) (hash EventHash, err error)
- func (pec *ParticipantEventsCache) GetLast(participant string) (hash EventHash, err error)
- func (pec *ParticipantEventsCache) Import(other *ParticipantEventsCache)
- func (pec *ParticipantEventsCache) Known() map[uint64]int64
- func (pec *ParticipantEventsCache) Reset() error
- func (pec *ParticipantEventsCache) Set(participant string, hash EventHash, index int64) error
- type Poset
- func (p *Poset) ApplyInternalTransactions(round int64, orderedEvents []Event) (res hash.Hash, err error)
- func (p *Poset) Bootstrap() error
- func (p *Poset) CheckBlock(block Block) error
- func (p *Poset) DecideAtropos() error
- func (p *Poset) DecideRoundReceived() error
- func (p *Poset) DivideRounds() error
- func (p *Poset) GetAnchorBlockWithFrame() (Block, Frame, error)
- func (p *Poset) GetConsensusTransactionsCount() uint64
- func (p *Poset) GetFrame(roundReceived int64) (Frame, error)
- func (p *Poset) GetLastConsensusRound() int64
- func (p *Poset) GetPeerFlagTableOfRandomUndeterminedEvent() (map[string]int64, error)
- func (p *Poset) GetPendingLoadedEvents() int64
- func (p *Poset) GetUndeterminedEvents() EventHashes
- func (p *Poset) InsertEvent(event Event, setWireInfo bool) error
- func (p *Poset) MakeFrame(roundReceived int64) (Frame, error)
- func (p *Poset) MapSentinels(x, y EventHash, sentinels map[string]bool) error
- func (p *Poset) ProcessDecidedRounds() error
- func (p *Poset) ProcessSigPool() error
- func (p *Poset) ReadWireInfo(wevent WireEvent) (*Event, error)
- func (p *Poset) Reset(block Block, frame Frame) error
- func (p *Poset) SetCore(core Core)
- func (p *Poset) SetWireInfo(event *Event) error
- func (p *Poset) SetWireInfoAndSign(event *Event, privKey *ecdsa.PrivateKey) error
- type Root
- func (*Root) Descriptor() ([]byte, []int)
- func (root *Root) Equals(that *Root) bool
- func (m *Root) GetNextRound() int64
- func (m *Root) GetOthers() map[string]*RootEvent
- func (m *Root) GetSelfParent() *RootEvent
- func (root *Root) ProtoMarshal() ([]byte, error)
- func (*Root) ProtoMessage()
- func (root *Root) ProtoUnmarshal(data []byte) error
- func (m *Root) Reset()
- func (m *Root) String() string
- func (m *Root) XXX_DiscardUnknown()
- func (m *Root) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Root) XXX_Merge(src proto.Message)
- func (m *Root) XXX_Size() int
- func (m *Root) XXX_Unmarshal(b []byte) error
- type RootEvent
- func (*RootEvent) Descriptor() ([]byte, []int)
- func (re *RootEvent) Equals(that *RootEvent) bool
- func (m *RootEvent) GetCreatorID() uint64
- func (m *RootEvent) GetHash() []byte
- func (m *RootEvent) GetIndex() int64
- func (m *RootEvent) GetLamportTimestamp() int64
- func (m *RootEvent) GetRound() int64
- func (*RootEvent) ProtoMessage()
- func (m *RootEvent) Reset()
- func (m *RootEvent) String() string
- func (m *RootEvent) XXX_DiscardUnknown()
- func (m *RootEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RootEvent) XXX_Merge(src proto.Message)
- func (m *RootEvent) XXX_Size() int
- func (m *RootEvent) XXX_Unmarshal(b []byte) error
- type RoundCreated
- func (r *RoundCreated) AddEvent(x EventHash, clotho bool)
- func (r *RoundCreated) Atropos() (res []EventHash)
- func (r *RoundCreated) Clotho() EventHashes
- func (r *RoundCreated) ClothoDecided() bool
- func (r *RoundCreated) ConsensusEvents() (res EventHashes)
- func (r *RoundCreated) Equals(that *RoundCreated) bool
- func (r *RoundCreated) IsDecided(clotho EventHash) bool
- func (r *RoundCreated) IsQueued() bool
- func (r *RoundCreated) ProtoMarshal() ([]byte, error)
- func (r *RoundCreated) ProtoUnmarshal(data []byte) error
- func (r *RoundCreated) RoundEvents() (res EventHashes)
- func (r *RoundCreated) SetAtropos(x EventHash, f bool)
- func (r *RoundCreated) SetConsensusEvent(x EventHash)
- func (r *RoundCreated) SetRoundReceived(x string, round int64)
- type RoundCreatedMessage
- func (*RoundCreatedMessage) Descriptor() ([]byte, []int)
- func (m *RoundCreatedMessage) GetEvents() map[string]*RoundEvent
- func (m *RoundCreatedMessage) GetQueued() bool
- func (*RoundCreatedMessage) ProtoMessage()
- func (m *RoundCreatedMessage) Reset()
- func (m *RoundCreatedMessage) String() string
- func (m *RoundCreatedMessage) XXX_DiscardUnknown()
- func (m *RoundCreatedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RoundCreatedMessage) XXX_Merge(src proto.Message)
- func (m *RoundCreatedMessage) XXX_Size() int
- func (m *RoundCreatedMessage) XXX_Unmarshal(b []byte) error
- type RoundEvent
- func (*RoundEvent) Descriptor() ([]byte, []int)
- func (re *RoundEvent) Equals(that *RoundEvent) bool
- func (m *RoundEvent) GetAtropos() Trilean
- func (m *RoundEvent) GetClotho() bool
- func (m *RoundEvent) GetConsensus() bool
- func (m *RoundEvent) GetRoundReceived() int64
- func (*RoundEvent) ProtoMessage()
- func (m *RoundEvent) Reset()
- func (m *RoundEvent) String() string
- func (m *RoundEvent) XXX_DiscardUnknown()
- func (m *RoundEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RoundEvent) XXX_Merge(src proto.Message)
- func (m *RoundEvent) XXX_Size() int
- func (m *RoundEvent) XXX_Unmarshal(b []byte) error
- type RoundReceived
- func (*RoundReceived) Descriptor() ([]byte, []int)
- func (m *RoundReceived) GetRounds() [][]byte
- func (r *RoundReceived) ProtoMarshal() ([]byte, error)
- func (*RoundReceived) ProtoMessage()
- func (r *RoundReceived) ProtoUnmarshal(data []byte) error
- func (m *RoundReceived) Reset()
- func (m *RoundReceived) String() string
- func (m *RoundReceived) XXX_DiscardUnknown()
- func (m *RoundReceived) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RoundReceived) XXX_Merge(src proto.Message)
- func (m *RoundReceived) XXX_Size() int
- func (m *RoundReceived) XXX_Unmarshal(b []byte) error
- type Store
- type Trilean
- type WireBlockSignature
- func (*WireBlockSignature) Descriptor() ([]byte, []int)
- func (wbs *WireBlockSignature) Equals(that *WireBlockSignature) bool
- func (m *WireBlockSignature) GetIndex() int64
- func (m *WireBlockSignature) GetSignature() string
- func (*WireBlockSignature) ProtoMessage()
- func (m *WireBlockSignature) Reset()
- func (m *WireBlockSignature) String() string
- func (m *WireBlockSignature) XXX_DiscardUnknown()
- func (m *WireBlockSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WireBlockSignature) XXX_Merge(src proto.Message)
- func (m *WireBlockSignature) XXX_Size() int
- func (m *WireBlockSignature) XXX_Unmarshal(b []byte) error
- type WireBody
- type WireEvent
Constants ¶
const LamportTimestampNIL int64 = -1
LamportTimestampNIL nil value for lamport
const RoundNIL int64 = -1
RoundNIL nil value for round
Variables ¶
var Trilean_name = map[int32]string{
0: "UNDEFINED",
1: "TRUE",
2: "FALSE",
}
var Trilean_value = map[string]int32{
"UNDEFINED": 0,
"TRUE": 1,
"FALSE": 2,
}
Functions ¶
func BlockSignatureListEquals ¶
func BlockSignatureListEquals(this []*BlockSignature, that []*BlockSignature) bool
BlockSignatureListEquals block signature list equality check
func EqualsMapStringRootEvent ¶
EqualsMapStringRootEvent compares the equality of two string maps of root events
func EqualsMapStringRoundEvent ¶
func EqualsMapStringRoundEvent(this map[string]*RoundEvent, that map[string]*RoundEvent) bool
EqualsMapStringRoundEvent compares a map string of round events for equality
func EventListEquals ¶
func EventListEquals(this []*EventMessage, that []*EventMessage) bool
EventListEquals compares the equality of two event lists
func InternalTransactionListEquals ¶
func InternalTransactionListEquals(this []*wire.InternalTransaction, that []*wire.InternalTransaction) bool
InternalTransactionListEquals list equality check
func ListBytesEquals ¶
ListBytesEquals compares the equality of two lists
func MapStringsEquals ¶
MapStringsEquals compares the equality of two string maps
func RootListEquals ¶
RootListEquals compares the equality of two root lists
Types ¶
type BadgerStore ¶
type BadgerStore struct {
// contains filtered or unexported fields
}
BadgerStore struct for badger config data
func LoadBadgerStore ¶
func LoadBadgerStore(cacheSize int, path string) (*BadgerStore, error)
LoadBadgerStore creates a Store from an existing database
func LoadOrCreateBadgerStore ¶
func LoadOrCreateBadgerStore(participants *peers.Peers, cacheSize int, path string, posConf *pos.Config) (*BadgerStore, error)
LoadOrCreateBadgerStore load or create a new badger store
func NewBadgerStore ¶
func NewBadgerStore(participants *peers.Peers, cacheSize int, path string, posConf *pos.Config) (*BadgerStore, error)
NewBadgerStore creates a brand new Store with a new database
func (*BadgerStore) AddConsensusEvent ¶
func (s *BadgerStore) AddConsensusEvent(event Event) error
AddConsensusEvent adds a consensus event to the store
func (*BadgerStore) CacheSize ¶
func (s *BadgerStore) CacheSize() int
CacheSize returns the cache size for the store
func (*BadgerStore) ConsensusEvents ¶
func (s *BadgerStore) ConsensusEvents() EventHashes
ConsensusEvents returns all consensus events
func (*BadgerStore) ConsensusEventsCount ¶
func (s *BadgerStore) ConsensusEventsCount() int64
ConsensusEventsCount returns the count for all known consensus events
func (*BadgerStore) GetBlock ¶
func (s *BadgerStore) GetBlock(rr int64) (Block, error)
GetBlock returns the block for a given index
func (*BadgerStore) GetEventBlock ¶
func (s *BadgerStore) GetEventBlock(hash EventHash) (event Event, err error)
GetEventBlock get specific event block by hash
func (*BadgerStore) GetFrame ¶
func (s *BadgerStore) GetFrame(rr int64) (Frame, error)
GetFrame returns a specific frame for the index
func (*BadgerStore) GetRoot ¶
func (s *BadgerStore) GetRoot(participant string) (Root, error)
GetRoot returns the root for a participant
func (*BadgerStore) GetRoundCreated ¶
func (s *BadgerStore) GetRoundCreated(r int64) (RoundCreated, error)
GetRoundCreated gets the created round info for a given index
func (*BadgerStore) GetRoundReceived ¶
func (s *BadgerStore) GetRoundReceived(r int64) (RoundReceived, error)
GetRoundReceived gets the received round for a given index
func (*BadgerStore) LastBlockIndex ¶
func (s *BadgerStore) LastBlockIndex() int64
LastBlockIndex returns the last block index (height)
func (*BadgerStore) LastConsensusEventFrom ¶
func (s *BadgerStore) LastConsensusEventFrom(participant string) (last EventHash, isRoot bool, err error)
LastConsensusEventFrom returns the last consensus events for a participant
func (*BadgerStore) LastEventFrom ¶
func (s *BadgerStore) LastEventFrom(participant string) (last EventHash, isRoot bool, err error)
LastEventFrom returns the last event for a participant
func (*BadgerStore) LastRound ¶
func (s *BadgerStore) LastRound() int64
LastRound returns the last round for the store
func (*BadgerStore) NeedBootstrap ¶
func (s *BadgerStore) NeedBootstrap() bool
NeedBootstrap checks if bootstrapping is required
func (*BadgerStore) ParticipantEvent ¶
func (s *BadgerStore) ParticipantEvent(participant string, index int64) (EventHash, error)
ParticipantEvent get specific participant event
func (*BadgerStore) ParticipantEvents ¶
func (s *BadgerStore) ParticipantEvents(participant string, skip int64) (EventHashes, error)
ParticipantEvents return all participant events
func (*BadgerStore) Participants ¶
func (s *BadgerStore) Participants() (*peers.Peers, error)
Participants returns all participants in the store
func (*BadgerStore) Reset ¶
func (s *BadgerStore) Reset(roots map[string]Root) error
Reset all roots
func (*BadgerStore) RootsByParticipant ¶
func (s *BadgerStore) RootsByParticipant() map[string]Root
RootsByParticipant returns PubKeyHex map of the roots
func (*BadgerStore) RootsBySelfParent ¶
func (s *BadgerStore) RootsBySelfParent() map[EventHash]Root
RootsBySelfParent returns Self Parent's EventHash map of the roots
func (*BadgerStore) RoundClothos ¶
func (s *BadgerStore) RoundClothos(r int64) EventHashes
RoundClothos returns all clothos for a round
func (*BadgerStore) RoundEvents ¶
func (s *BadgerStore) RoundEvents(r int64) int
RoundEvents returns all events for a round
func (*BadgerStore) SetBlock ¶
func (s *BadgerStore) SetBlock(block Block) error
SetBlock add a block
func (*BadgerStore) SetEvent ¶
func (s *BadgerStore) SetEvent(event Event) error
SetEvent set a specific event
func (*BadgerStore) SetFrame ¶
func (s *BadgerStore) SetFrame(frame Frame) error
SetFrame add a frame
func (*BadgerStore) SetRoundCreated ¶
func (s *BadgerStore) SetRoundCreated(r int64, round RoundCreated) error
SetRoundCreated sets the created round info for a given index
func (*BadgerStore) SetRoundReceived ¶
func (s *BadgerStore) SetRoundReceived(r int64, round RoundReceived) error
SetRoundReceived sets the received round info for a given index
func (*BadgerStore) StateDB ¶
func (s *BadgerStore) StateDB() state.Database
StateDB returns state database
func (*BadgerStore) StateRoot ¶
func (s *BadgerStore) StateRoot() hash.Hash
StateRoot returns genesis state hash.
func (*BadgerStore) StorePath ¶
func (s *BadgerStore) StorePath() string
StorePath returns the path to the file on disk
func (*BadgerStore) TopologicalEvents ¶
func (s *BadgerStore) TopologicalEvents() ([]Event, error)
TopologicalEvents returns event in topological order.
type Block ¶
type Block struct { Body *BlockBody `protobuf:"bytes,1,opt,name=Body,proto3" json:"Body,omitempty"` Signatures map[string]string `` /* 161-byte string literal not displayed */ Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` Hex string `protobuf:"bytes,4,opt,name=hex,proto3" json:"hex,omitempty"` StateHash []byte `protobuf:"bytes,5,opt,name=StateHash,proto3" json:"StateHash,omitempty"` FrameHash []byte `protobuf:"bytes,6,opt,name=FrameHash,proto3" json:"FrameHash,omitempty"` CreatedTime int64 `protobuf:"varint,7,opt,name=CreatedTime,proto3" json:"CreatedTime,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewBlockFromFrame ¶
NewBlockFromFrame creates a new block from the given frame
func (*Block) AppendTransactions ¶
AppendTransactions appends the transactions to the block body
func (*Block) Descriptor ¶
func (*Block) GetBlockSignatures ¶
func (b *Block) GetBlockSignatures() []BlockSignature
GetBlockSignatures returns the block signatures for the block
func (*Block) GetCreatedTime ¶
func (*Block) GetFrameHash ¶
func (*Block) GetSignature ¶
func (b *Block) GetSignature(validator string) (res BlockSignature, err error)
GetSignature returns all validator signatures for the block
func (*Block) GetSignatures ¶
func (*Block) GetStateHash ¶
func (*Block) ProtoMarshal ¶
ProtoMarshal marshals the block into protobuff
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoUnmarshal ¶
ProtoUnmarshal marshals protobuf into a block
func (*Block) RoundReceived ¶
RoundReceived returns the round in which the block was received
func (*Block) SetSignature ¶
func (b *Block) SetSignature(bs BlockSignature) error
SetSignature sets the known blocksignatures for the block
func (*Block) Sign ¶
func (b *Block) Sign(privKey *ecdsa.PrivateKey) (bs BlockSignature, err error)
Sign the block for this node
func (*Block) Transactions ¶
Transactions returns the transactions in a block
func (*Block) Verify ¶
func (b *Block) Verify(sig BlockSignature) (bool, error)
Verify verifies a blocksignature is from the node that signed
func (*Block) XXX_DiscardUnknown ¶
func (m *Block) XXX_DiscardUnknown()
func (*Block) XXX_Marshal ¶
func (*Block) XXX_Unmarshal ¶
type BlockBody ¶
type BlockBody struct { Index int64 `protobuf:"varint,1,opt,name=Index,proto3" json:"Index,omitempty"` RoundReceived int64 `protobuf:"varint,2,opt,name=RoundReceived,proto3" json:"RoundReceived,omitempty"` Transactions [][]byte `protobuf:"bytes,5,rep,name=Transactions,proto3" json:"Transactions,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*BlockBody) Descriptor ¶
func (*BlockBody) GetRoundReceived ¶
func (*BlockBody) GetTransactions ¶
func (*BlockBody) ProtoMarshal ¶
ProtoMarshal json encoding of body only
func (*BlockBody) ProtoMessage ¶
func (*BlockBody) ProtoMessage()
func (*BlockBody) ProtoUnmarshal ¶
ProtoUnmarshal unmarshal the protobuff for the block body
func (*BlockBody) XXX_DiscardUnknown ¶
func (m *BlockBody) XXX_DiscardUnknown()
func (*BlockBody) XXX_Marshal ¶
func (*BlockBody) XXX_Unmarshal ¶
type BlockSignature ¶
type BlockSignature struct { Validator []byte `protobuf:"bytes,1,opt,name=Validator,proto3" json:"Validator,omitempty"` Index int64 `protobuf:"varint,2,opt,name=Index,proto3" json:"Index,omitempty"` Signature string `protobuf:"bytes,3,opt,name=Signature,proto3" json:"Signature,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*BlockSignature) Descriptor ¶
func (*BlockSignature) Descriptor() ([]byte, []int)
func (*BlockSignature) Equals ¶
func (bs *BlockSignature) Equals(that *BlockSignature) bool
Equals checks blocksignature equality
func (*BlockSignature) GetIndex ¶
func (m *BlockSignature) GetIndex() int64
func (*BlockSignature) GetSignature ¶
func (m *BlockSignature) GetSignature() string
func (*BlockSignature) GetValidator ¶
func (m *BlockSignature) GetValidator() []byte
func (*BlockSignature) ProtoMarshal ¶
func (bs *BlockSignature) ProtoMarshal() ([]byte, error)
ProtoMarshal marshal the block signatures to protobuff
func (*BlockSignature) ProtoMessage ¶
func (*BlockSignature) ProtoMessage()
func (*BlockSignature) ProtoUnmarshal ¶
func (bs *BlockSignature) ProtoUnmarshal(data []byte) error
ProtoUnmarshal unmarshals the blocksignature from protobuff
func (*BlockSignature) Reset ¶
func (m *BlockSignature) Reset()
func (*BlockSignature) String ¶
func (m *BlockSignature) String() string
func (*BlockSignature) ToWire ¶
func (bs *BlockSignature) ToWire() WireBlockSignature
ToWire converts block signatures to wire (transport)
func (*BlockSignature) ValidatorHex ¶
func (bs *BlockSignature) ValidatorHex() string
ValidatorHex returns the Hex ID of a validator for this block
func (*BlockSignature) XXX_DiscardUnknown ¶
func (m *BlockSignature) XXX_DiscardUnknown()
func (*BlockSignature) XXX_Marshal ¶
func (m *BlockSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BlockSignature) XXX_Merge ¶
func (m *BlockSignature) XXX_Merge(src proto.Message)
func (*BlockSignature) XXX_Size ¶
func (m *BlockSignature) XXX_Size() int
func (*BlockSignature) XXX_Unmarshal ¶
func (m *BlockSignature) XXX_Unmarshal(b []byte) error
type ByLamportTimestamp ¶
type ByLamportTimestamp []Event
ByLamportTimestamp implements sort.Interface for []Event based on the lamportTimestamp field. THIS IS A TOTAL ORDER
func (ByLamportTimestamp) Len ¶
func (a ByLamportTimestamp) Len() int
func (ByLamportTimestamp) Less ¶
func (a ByLamportTimestamp) Less(i, j int) bool
func (ByLamportTimestamp) Swap ¶
func (a ByLamportTimestamp) Swap(i, j int)
type ByTopologicalOrder ¶
type ByTopologicalOrder []Event
ByTopologicalOrder implements sort.Interface for []Event based on the topologicalIndex field. THIS IS A PARTIAL ORDER
func (ByTopologicalOrder) Len ¶
func (a ByTopologicalOrder) Len() int
func (ByTopologicalOrder) Less ¶
func (a ByTopologicalOrder) Less(i, j int) bool
func (ByTopologicalOrder) Swap ¶
func (a ByTopologicalOrder) Swap(i, j int)
type Event ¶
type Event struct { Message *EventMessage // contains filtered or unexported fields }
Event struct
func NewEvent ¶
func NewEvent( transactions [][]byte, internalTransactions []*wire.InternalTransaction, blockSignatures []BlockSignature, parents EventHashes, creator []byte, index int64, ft FlagTable) Event
NewEvent creates new block event.
func (*Event) BlockSignatures ¶
func (e *Event) BlockSignatures() []*BlockSignature
BlockSignatures returns all block signatures for this event
func (*Event) GetCreator ¶
GetCreator returns the creator for the event
func (*Event) GetFlagTable ¶
GetFlagTable returns the flag table.
func (*Event) GetLamportTimestamp ¶
GetLamportTimestamp returns the lamport timestamp
func (*Event) GetRoundReceived ¶
GetRoundReceived Round returns round in which the event is received.
func (*Event) InternalTransactions ¶
func (e *Event) InternalTransactions() []*wire.InternalTransaction
InternalTransactions returns all internal transactions in the event
func (*Event) IsLoaded ¶
IsLoaded True if Event contains a payload or is the initial Event of its creator
func (*Event) MergeFlagTable ¶
MergeFlagTable returns merged flag table object.
func (*Event) OtherParent ¶
OtherParent returns the other (not creators) parent(s) hash(es)
func (*Event) OtherParentCreatorID ¶
OtherParentCreatorID ID of other parent(s)
func (*Event) ProtoMarshal ¶
ProtoMarshal event to protobuff
func (*Event) ProtoUnmarshal ¶
ProtoUnmarshal profotbuff to event
func (*Event) ReplaceFlagTable ¶
ReplaceFlagTable replaces flag table.
func (*Event) SelfParent ¶
SelfParent returns the previous event block hash in this creator DAG
func (*Event) SetLamportTimestamp ¶
SetLamportTimestamp for event
func (*Event) SetRoundReceived ¶
SetRoundReceived for event
func (*Event) SetWireInfo ¶
func (e *Event) SetWireInfo(selfParentIndex int64, otherParentCreatorID uint64, otherParentIndex int64, creatorID uint64)
SetWireInfo for event
func (*Event) Transactions ¶
Transactions returns all transactions in the event
func (*Event) WireBlockSignatures ¶
func (e *Event) WireBlockSignatures() []WireBlockSignature
WireBlockSignatures returns the wire block signatures for the event
type EventBody ¶
type EventBody struct { Transactions [][]byte `protobuf:"bytes,1,rep,name=Transactions,proto3" json:"Transactions,omitempty"` InternalTransactions []*wire.InternalTransaction `protobuf:"bytes,2,rep,name=InternalTransactions,proto3" json:"InternalTransactions,omitempty"` Parents [][]byte `protobuf:"bytes,3,rep,name=Parents,proto3" json:"Parents,omitempty"` Creator []byte `protobuf:"bytes,4,opt,name=Creator,proto3" json:"Creator,omitempty"` Index int64 `protobuf:"varint,5,opt,name=Index,proto3" json:"Index,omitempty"` BlockSignatures []*BlockSignature `protobuf:"bytes,6,rep,name=BlockSignatures,proto3" json:"BlockSignatures,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*EventBody) Descriptor ¶
func (*EventBody) GetBlockSignatures ¶
func (m *EventBody) GetBlockSignatures() []*BlockSignature
func (*EventBody) GetCreator ¶
func (*EventBody) GetInternalTransactions ¶
func (m *EventBody) GetInternalTransactions() []*wire.InternalTransaction
func (*EventBody) GetParents ¶
func (*EventBody) GetTransactions ¶
func (*EventBody) ProtoMarshal ¶
ProtoMarshal marshal event body to protobuff
func (*EventBody) ProtoMessage ¶
func (*EventBody) ProtoMessage()
func (*EventBody) ProtoUnmarshal ¶
ProtoUnmarshal unmarshal protobuff to event body
func (*EventBody) XXX_DiscardUnknown ¶
func (m *EventBody) XXX_DiscardUnknown()
func (*EventBody) XXX_Marshal ¶
func (*EventBody) XXX_Unmarshal ¶
type EventHash ¶
EventHash is a dedicated type for Event's hash.
func CalcEventHash ¶
CalcEventHash calculates hash of data.
func GenRootSelfParent ¶
GenRootSelfParent generates Event's parent hash from participant ID. Use it for first Event only.
type EventHashes ¶
type EventHashes []EventHash
EventHashes provides additional methods of EventHash slice.
func (EventHashes) Bytes ¶
func (hashes EventHashes) Bytes() [][]byte
Bytes returns values as slice of bytes.
func (EventHashes) Contains ¶
func (hashes EventHashes) Contains(hash EventHash) bool
Contains returns true if there is the hash in values.
func (EventHashes) Len ¶
func (hashes EventHashes) Len() int
Len is a part of sort.Interface implementation.
func (EventHashes) Less ¶
func (hashes EventHashes) Less(i, j int) bool
Less is a part of sort.Interface implementation.
func (EventHashes) Strings ¶
func (hashes EventHashes) Strings() []string
Strings returns values as slice of hex strings.
func (EventHashes) Swap ¶
func (hashes EventHashes) Swap(i, j int)
Swap is a part of sort.Interface implementation.
type EventMessage ¶
type EventMessage struct { Body *EventBody `protobuf:"bytes,1,opt,name=Body,proto3" json:"Body,omitempty"` Signature string `protobuf:"bytes,2,opt,name=Signature,proto3" json:"Signature,omitempty"` FlagTable []byte `protobuf:"bytes,3,opt,name=FlagTable,proto3" json:"FlagTable,omitempty"` ClothoProof [][]byte `protobuf:"bytes,4,rep,name=ClothoProof,proto3" json:"ClothoProof,omitempty"` SelfParentIndex int64 `protobuf:"varint,5,opt,name=SelfParentIndex,proto3" json:"SelfParentIndex,omitempty"` OtherParentCreatorID uint64 `protobuf:"varint,6,opt,name=OtherParentCreatorID,proto3" json:"OtherParentCreatorID,omitempty"` OtherParentIndex int64 `protobuf:"varint,7,opt,name=OtherParentIndex,proto3" json:"OtherParentIndex,omitempty"` CreatorID uint64 `protobuf:"varint,8,opt,name=CreatorID,proto3" json:"CreatorID,omitempty"` TopologicalIndex int64 `protobuf:"varint,9,opt,name=TopologicalIndex,proto3" json:"TopologicalIndex,omitempty"` Hash []byte `protobuf:"bytes,10,opt,name=Hash,proto3" json:"Hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*EventMessage) Descriptor ¶
func (*EventMessage) Descriptor() ([]byte, []int)
func (*EventMessage) Equals ¶
func (m *EventMessage) Equals(that *EventMessage) bool
Equals compares equality of two event messages
func (*EventMessage) GetBody ¶
func (m *EventMessage) GetBody() *EventBody
func (*EventMessage) GetClothoProof ¶
func (m *EventMessage) GetClothoProof() [][]byte
func (*EventMessage) GetCreatorID ¶
func (m *EventMessage) GetCreatorID() uint64
func (*EventMessage) GetFlagTable ¶
func (m *EventMessage) GetFlagTable() []byte
func (*EventMessage) GetHash ¶
func (m *EventMessage) GetHash() []byte
func (*EventMessage) GetOtherParentCreatorID ¶
func (m *EventMessage) GetOtherParentCreatorID() uint64
func (*EventMessage) GetOtherParentIndex ¶
func (m *EventMessage) GetOtherParentIndex() int64
func (*EventMessage) GetSelfParentIndex ¶
func (m *EventMessage) GetSelfParentIndex() int64
func (*EventMessage) GetSignature ¶
func (m *EventMessage) GetSignature() string
func (*EventMessage) GetTopologicalIndex ¶
func (m *EventMessage) GetTopologicalIndex() int64
func (*EventMessage) ProtoMessage ¶
func (*EventMessage) ProtoMessage()
func (*EventMessage) Reset ¶
func (m *EventMessage) Reset()
func (*EventMessage) String ¶
func (m *EventMessage) String() string
func (*EventMessage) ToEvent ¶
func (m *EventMessage) ToEvent() Event
ToEvent converts message to event
func (*EventMessage) XXX_DiscardUnknown ¶
func (m *EventMessage) XXX_DiscardUnknown()
func (*EventMessage) XXX_Marshal ¶
func (m *EventMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventMessage) XXX_Merge ¶
func (m *EventMessage) XXX_Merge(src proto.Message)
func (*EventMessage) XXX_Size ¶
func (m *EventMessage) XXX_Size() int
func (*EventMessage) XXX_Unmarshal ¶
func (m *EventMessage) XXX_Unmarshal(b []byte) error
type FlagTable ¶
FlagTable is a dedicated type for the Events flags map.
type FlagTableWrapper ¶
type FlagTableWrapper struct { Body map[string]int64 `` /* 150-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FlagTableWrapper) Descriptor ¶
func (*FlagTableWrapper) Descriptor() ([]byte, []int)
func (*FlagTableWrapper) GetBody ¶
func (m *FlagTableWrapper) GetBody() map[string]int64
func (*FlagTableWrapper) ProtoMessage ¶
func (*FlagTableWrapper) ProtoMessage()
func (*FlagTableWrapper) Reset ¶
func (m *FlagTableWrapper) Reset()
func (*FlagTableWrapper) String ¶
func (m *FlagTableWrapper) String() string
func (*FlagTableWrapper) XXX_DiscardUnknown ¶
func (m *FlagTableWrapper) XXX_DiscardUnknown()
func (*FlagTableWrapper) XXX_Marshal ¶
func (m *FlagTableWrapper) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FlagTableWrapper) XXX_Merge ¶
func (m *FlagTableWrapper) XXX_Merge(src proto.Message)
func (*FlagTableWrapper) XXX_Size ¶
func (m *FlagTableWrapper) XXX_Size() int
func (*FlagTableWrapper) XXX_Unmarshal ¶
func (m *FlagTableWrapper) XXX_Unmarshal(b []byte) error
type Frame ¶
type Frame struct { Round int64 `protobuf:"varint,1,opt,name=Round,proto3" json:"Round,omitempty"` Roots []*Root `protobuf:"bytes,2,rep,name=Roots,proto3" json:"Roots,omitempty"` Events []*EventMessage `protobuf:"bytes,3,rep,name=Events,proto3" json:"Events,omitempty"` StateHash []byte `protobuf:"bytes,4,opt,name=StateHash,proto3" json:"StateHash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Frame) Descriptor ¶
func (*Frame) GetEventBlocks ¶
func (f *Frame) GetEventBlocks() []*EventMessage
GetEventBlocks provides alternative for non-existent Protobuf generated function
func (*Frame) GetEvents ¶
func (m *Frame) GetEvents() []*EventMessage
func (*Frame) GetStateHash ¶
func (*Frame) ProtoMarshal ¶
ProtoMarshal json encoding of Frame
func (*Frame) ProtoMessage ¶
func (*Frame) ProtoMessage()
func (*Frame) ProtoUnmarshal ¶
ProtoUnmarshal converts protobuf to frame
func (*Frame) XXX_DiscardUnknown ¶
func (m *Frame) XXX_DiscardUnknown()
func (*Frame) XXX_Marshal ¶
func (*Frame) XXX_Unmarshal ¶
type InmemStore ¶
type InmemStore struct {
// contains filtered or unexported fields
}
InmemStore struct
func NewInmemStore ¶
NewInmemStore constructor
func (*InmemStore) AddConsensusEvent ¶
func (s *InmemStore) AddConsensusEvent(event Event) error
AddConsensusEvent to store
func (*InmemStore) ConsensusEvents ¶
func (s *InmemStore) ConsensusEvents() EventHashes
ConsensusEvents returns all consensus events
func (*InmemStore) ConsensusEventsCount ¶
func (s *InmemStore) ConsensusEventsCount() int64
ConsensusEventsCount returns count of all consnesus events
func (*InmemStore) GetBlock ¶
func (s *InmemStore) GetBlock(index int64) (Block, error)
GetBlock for index
func (*InmemStore) GetEventBlock ¶
func (s *InmemStore) GetEventBlock(hash EventHash) (Event, error)
GetEventBlock gets specific event block by hash
func (*InmemStore) GetFrame ¶
func (s *InmemStore) GetFrame(index int64) (Frame, error)
GetFrame by index
func (*InmemStore) GetRoot ¶
func (s *InmemStore) GetRoot(participant string) (Root, error)
GetRoot for participant
func (*InmemStore) GetRoundCreated ¶
func (s *InmemStore) GetRoundCreated(r int64) (RoundCreated, error)
GetRoundCreated retrieves created round by ID
func (*InmemStore) GetRoundReceived ¶
func (s *InmemStore) GetRoundReceived(r int64) (RoundReceived, error)
GetRoundReceived gets received round by ID
func (*InmemStore) LastBlockIndex ¶
func (s *InmemStore) LastBlockIndex() int64
LastBlockIndex getter
func (*InmemStore) LastConsensusEventFrom ¶
func (s *InmemStore) LastConsensusEventFrom(participant string) (last EventHash, isRoot bool, err error)
LastConsensusEventFrom participant
func (*InmemStore) LastEventFrom ¶
func (s *InmemStore) LastEventFrom(participant string) (last EventHash, isRoot bool, err error)
LastEventFrom participant
func (*InmemStore) NeedBootstrap ¶
func (s *InmemStore) NeedBootstrap() bool
NeedBootstrap for the store
func (*InmemStore) ParticipantEvent ¶
func (s *InmemStore) ParticipantEvent(participant string, index int64) (hash EventHash, err error)
ParticipantEvent specific event
func (*InmemStore) ParticipantEvents ¶
func (s *InmemStore) ParticipantEvents(participant string, skip int64) (EventHashes, error)
ParticipantEvents events for the participant
func (*InmemStore) Participants ¶
func (s *InmemStore) Participants() (*peers.Peers, error)
Participants returns participants
func (*InmemStore) Reset ¶
func (s *InmemStore) Reset(roots map[string]Root) error
Reset resets the store
func (*InmemStore) RootsByParticipant ¶
func (s *InmemStore) RootsByParticipant() map[string]Root
RootsByParticipant retrieve PubKeyHex map of roots
func (*InmemStore) RootsBySelfParent ¶
func (s *InmemStore) RootsBySelfParent() map[EventHash]Root
RootsBySelfParent retrieve EventHash map of roots
func (*InmemStore) RoundClothos ¶
func (s *InmemStore) RoundClothos(r int64) EventHashes
RoundClothos all clothos for the specified round
func (*InmemStore) RoundEvents ¶
func (s *InmemStore) RoundEvents(r int64) int
RoundEvents returns events for the round
func (*InmemStore) SetEvent ¶
func (s *InmemStore) SetEvent(event Event) error
SetEvent set event for event block
func (*InmemStore) SetFrame ¶
func (s *InmemStore) SetFrame(frame Frame) error
SetFrame in the store
func (*InmemStore) SetRoundCreated ¶
func (s *InmemStore) SetRoundCreated(r int64, round RoundCreated) error
SetRoundCreated stores created round by ID
func (*InmemStore) SetRoundReceived ¶
func (s *InmemStore) SetRoundReceived(r int64, round RoundReceived) error
SetRoundReceived stores received round by ID
func (*InmemStore) StateDB ¶
func (s *InmemStore) StateDB() state.Database
StateDB returns state database
func (*InmemStore) StateRoot ¶
func (s *InmemStore) StateRoot() hash.Hash
StateRoot returns genesis state hash.
func (*InmemStore) TopologicalEvents ¶
func (s *InmemStore) TopologicalEvents() ([]Event, error)
TopologicalEvents returns event in topological order.
type ParentRoundInfo ¶
type ParentRoundInfo struct { Atropos int // contains filtered or unexported fields }
ParentRoundInfo struct
func NewBaseParentRoundInfo ¶
func NewBaseParentRoundInfo() ParentRoundInfo
NewBaseParentRoundInfo constructor
type ParticipantBlockSignaturesCache ¶
type ParticipantBlockSignaturesCache struct {
// contains filtered or unexported fields
}
ParticipantBlockSignaturesCache struct
func NewParticipantBlockSignaturesCache ¶
func NewParticipantBlockSignaturesCache(size int, participants *peers.Peers) *ParticipantBlockSignaturesCache
NewParticipantBlockSignaturesCache constructor
func (*ParticipantBlockSignaturesCache) Get ¶
func (psc *ParticipantBlockSignaturesCache) Get(participant string, skipIndex int64) ([]BlockSignature, error)
Get return participant BlockSignatures where index > skip
func (*ParticipantBlockSignaturesCache) GetItem ¶
func (psc *ParticipantBlockSignaturesCache) GetItem(participant string, index int64) (BlockSignature, error)
GetItem get block signature at index for participant
func (*ParticipantBlockSignaturesCache) GetLast ¶
func (psc *ParticipantBlockSignaturesCache) GetLast(participant string) (BlockSignature, error)
GetLast get last block signature for participant
func (*ParticipantBlockSignaturesCache) Known ¶
func (psc *ParticipantBlockSignaturesCache) Known() map[uint64]int64
Known returns [participant id] => last BlockSignature Index
func (*ParticipantBlockSignaturesCache) Reset ¶
func (psc *ParticipantBlockSignaturesCache) Reset() error
Reset resets the block signature cache
func (*ParticipantBlockSignaturesCache) Set ¶
func (psc *ParticipantBlockSignaturesCache) Set(participant string, sig BlockSignature) error
Set sets the last block signature for the participant
type ParticipantEventsCache ¶
type ParticipantEventsCache struct {
// contains filtered or unexported fields
}
ParticipantEventsCache struct
func NewParticipantEventsCache ¶
func NewParticipantEventsCache(size int, participants *peers.Peers) *ParticipantEventsCache
NewParticipantEventsCache constructor
func (*ParticipantEventsCache) AddPeer ¶
func (pec *ParticipantEventsCache) AddPeer(peer *peers.Peer) error
AddPeer adds peer to cache and rolling index map, returns error if it failed to add to map
func (*ParticipantEventsCache) Get ¶
func (pec *ParticipantEventsCache) Get(participant string, skipIndex int64) (EventHashes, error)
Get return participant events with index > skip
func (*ParticipantEventsCache) GetItem ¶
func (pec *ParticipantEventsCache) GetItem(participant string, index int64) (hash EventHash, err error)
GetItem get event for participant at index
func (*ParticipantEventsCache) GetLast ¶
func (pec *ParticipantEventsCache) GetLast(participant string) (hash EventHash, err error)
GetLast get last event for participant
func (*ParticipantEventsCache) Import ¶
func (pec *ParticipantEventsCache) Import(other *ParticipantEventsCache)
Import from another event cache
func (*ParticipantEventsCache) Known ¶
func (pec *ParticipantEventsCache) Known() map[uint64]int64
Known returns [participant id] => lastKnownIndex
func (*ParticipantEventsCache) Reset ¶
func (pec *ParticipantEventsCache) Reset() error
Reset resets the event cache
type Poset ¶
type Poset struct { Participants *peers.Peers // [public key] => id Store Store // store of Events, Rounds, and Blocks UndeterminedEvents []EventHash // [index] => hash . FIFO queue of Events whose consensus order is not yet determined PendingRounds []*pendingRound // FIFO queue of Rounds which have not attained consensus yet PendingRoundReceived common.Int64Slice // FIFO queue of RoundReceived which have not been made into frames yet LastConsensusRound *int64 // index of last consensus round FirstConsensusRound *int64 // index of first consensus round (only used in tests) AnchorBlock *int64 // index of last block with enough signatures LastCommittedRoundEvents int // number of events in round before LastConsensusRound SigPool []BlockSignature // Pool of Block signatures that need to be processed ConsensusTransactions uint64 // number of consensus transactions // contains filtered or unexported fields }
Poset is a DAG of Events. It also contains methods to extract a consensus order of Events and map them onto a blockchain.
func NewPoset ¶
func NewPoset(participants *peers.Peers, store Store, commitCh chan Block, logger *logrus.Entry) *Poset
NewPoset instantiates a Poset from a list of participants, underlying data store and commit channel
func (*Poset) ApplyInternalTransactions ¶
func (p *Poset) ApplyInternalTransactions(round int64, orderedEvents []Event) (res hash.Hash, err error)
ApplyInternalTransactions calcs new PoS-state from prev round's state and returns its hash.
func (*Poset) Bootstrap ¶
Bootstrap loads all Events from the Store's DB (if there is one) and feeds them to the Poset (in topological order) for consensus ordering. After this method call, the Poset should be in a state coherent with the 'tip' of the Poset
func (*Poset) CheckBlock ¶
CheckBlock returns an error if the Block does not contain valid signatures from MORE than 1/3 of participants
func (*Poset) DecideAtropos ¶
DecideAtropos decides if clothos are atropos
func (*Poset) DecideRoundReceived ¶
DecideRoundReceived assigns a RoundReceived to undetermined events when they reach consensus
func (*Poset) DivideRounds ¶
DivideRounds assigns a Round and LamportTimestamp to Events, and flags them as clothos if necessary. Pushes Rounds in the PendingRounds queue if necessary.
func (*Poset) GetAnchorBlockWithFrame ¶
GetAnchorBlockWithFrame returns the AnchorBlock and the corresponding Frame. This can be used as a base to Reset a Poset
func (*Poset) GetConsensusTransactionsCount ¶
GetConsensusTransactionsCount returns the count of finalized transactions
func (*Poset) GetLastConsensusRound ¶
GetLastConsensusRound returns the last consensus round
func (*Poset) GetPeerFlagTableOfRandomUndeterminedEvent ¶
GetPeerFlagTableOfRandomUndeterminedEvent returns the flag table for undermined events
func (*Poset) GetPendingLoadedEvents ¶
GetPendingLoadedEvents returns all the pending events
func (*Poset) GetUndeterminedEvents ¶
func (p *Poset) GetUndeterminedEvents() EventHashes
GetUndeterminedEvents returns all the undetermined events
func (*Poset) InsertEvent ¶
InsertEvent attempts to insert an Event in the DAG. It verifies the signature, checks the dominators are known, and prevents the introduction of forks.
func (*Poset) MapSentinels ¶
MapSentinels participants in x's dominator that dominate y
func (*Poset) ProcessDecidedRounds ¶
ProcessDecidedRounds takes Rounds whose clothos are decided, computes the corresponding Frames, maps them into Blocks, and commits the Blocks via the commit channel
func (*Poset) ProcessSigPool ¶
ProcessSigPool runs through the SignaturePool and tries to map a Signature to a known Block. If a Signature is found to be valid for a known Block, it is appended to the block and removed from the SignaturePool
func (*Poset) ReadWireInfo ¶
ReadWireInfo converts a WireEvent to an Event by replacing int IDs with the corresponding public keys.
func (*Poset) SetWireInfo ¶
SetWireInfo set wire info for the event
func (*Poset) SetWireInfoAndSign ¶
func (p *Poset) SetWireInfoAndSign(event *Event, privKey *ecdsa.PrivateKey) error
SetWireInfoAndSign set wire info for the event and sign
type Root ¶
type Root struct { NextRound int64 `protobuf:"varint,1,opt,name=NextRound,proto3" json:"NextRound,omitempty"` SelfParent *RootEvent `protobuf:"bytes,2,opt,name=SelfParent,proto3" json:"SelfParent,omitempty"` Others map[string]*RootEvent `` /* 153-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewBaseRoot ¶
NewBaseRoot initializes a Root object for a fresh Poset.
func (*Root) Descriptor ¶
func (*Root) GetNextRound ¶
func (*Root) GetSelfParent ¶
func (*Root) ProtoMarshal ¶
ProtoMarshal converts root to protobuff
func (*Root) ProtoMessage ¶
func (*Root) ProtoMessage()
func (*Root) ProtoUnmarshal ¶
ProtoUnmarshal converts protobuff to a root struct
func (*Root) XXX_DiscardUnknown ¶
func (m *Root) XXX_DiscardUnknown()
func (*Root) XXX_Unmarshal ¶
type RootEvent ¶
type RootEvent struct { Hash []byte `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"` CreatorID uint64 `protobuf:"varint,2,opt,name=CreatorID,proto3" json:"CreatorID,omitempty"` Index int64 `protobuf:"varint,3,opt,name=Index,proto3" json:"Index,omitempty"` LamportTimestamp int64 `protobuf:"varint,4,opt,name=LamportTimestamp,proto3" json:"LamportTimestamp,omitempty"` Round int64 `protobuf:"varint,5,opt,name=Round,proto3" json:"Round,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewBaseRootEvent ¶
NewBaseRootEvent creates a RootEvent corresponding to the the very beginning of a Poset.
func (*RootEvent) Descriptor ¶
func (*RootEvent) GetCreatorID ¶
func (*RootEvent) GetLamportTimestamp ¶
func (*RootEvent) ProtoMessage ¶
func (*RootEvent) ProtoMessage()
func (*RootEvent) XXX_DiscardUnknown ¶
func (m *RootEvent) XXX_DiscardUnknown()
func (*RootEvent) XXX_Marshal ¶
func (*RootEvent) XXX_Unmarshal ¶
type RoundCreated ¶
type RoundCreated struct {
Message RoundCreatedMessage
}
RoundCreated wrapper for protobuf created round event messages
func NewRoundCreated ¶
func NewRoundCreated() *RoundCreated
NewRoundCreated creates a new round info struct
func (*RoundCreated) AddEvent ¶
func (r *RoundCreated) AddEvent(x EventHash, clotho bool)
AddEvent add event to round info (optionally set clotho)
func (*RoundCreated) Atropos ¶
func (r *RoundCreated) Atropos() (res []EventHash)
Atropos return Atropos
func (*RoundCreated) ClothoDecided ¶
func (r *RoundCreated) ClothoDecided() bool
ClothoDecided return true if no clothos' fame is left undefined
func (*RoundCreated) ConsensusEvents ¶
func (r *RoundCreated) ConsensusEvents() (res EventHashes)
ConsensusEvents returns all consensus events for the created round
func (*RoundCreated) Equals ¶
func (r *RoundCreated) Equals(that *RoundCreated) bool
Equals compares two round created structs for equality
func (*RoundCreated) IsDecided ¶
func (r *RoundCreated) IsDecided(clotho EventHash) bool
IsDecided checks if the event is a decided clotho
func (*RoundCreated) IsQueued ¶
func (r *RoundCreated) IsQueued() bool
IsQueued returns whether the RoundCreated is queued for processing in PendingRounds
func (*RoundCreated) ProtoMarshal ¶
func (r *RoundCreated) ProtoMarshal() ([]byte, error)
ProtoMarshal marshals the created round to protobuf
func (*RoundCreated) ProtoUnmarshal ¶
func (r *RoundCreated) ProtoUnmarshal(data []byte) error
ProtoUnmarshal de-serialises the created round using protobuf
func (*RoundCreated) RoundEvents ¶
func (r *RoundCreated) RoundEvents() (res EventHashes)
RoundEvents returns all non-consensus events for the created round
func (*RoundCreated) SetAtropos ¶
func (r *RoundCreated) SetAtropos(x EventHash, f bool)
SetAtropos sets whether the given event is Atropos, otherwise it is Clotho when not found
func (*RoundCreated) SetConsensusEvent ¶
func (r *RoundCreated) SetConsensusEvent(x EventHash)
SetConsensusEvent set an event as a consensus event
func (*RoundCreated) SetRoundReceived ¶
func (r *RoundCreated) SetRoundReceived(x string, round int64)
SetRoundReceived set the received round for the given event
type RoundCreatedMessage ¶
type RoundCreatedMessage struct { Events map[string]*RoundEvent `` /* 153-byte string literal not displayed */ Queued bool `protobuf:"varint,2,opt,name=queued,proto3" json:"queued,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RoundCreatedMessage) Descriptor ¶
func (*RoundCreatedMessage) Descriptor() ([]byte, []int)
func (*RoundCreatedMessage) GetEvents ¶
func (m *RoundCreatedMessage) GetEvents() map[string]*RoundEvent
func (*RoundCreatedMessage) GetQueued ¶
func (m *RoundCreatedMessage) GetQueued() bool
func (*RoundCreatedMessage) ProtoMessage ¶
func (*RoundCreatedMessage) ProtoMessage()
func (*RoundCreatedMessage) Reset ¶
func (m *RoundCreatedMessage) Reset()
func (*RoundCreatedMessage) String ¶
func (m *RoundCreatedMessage) String() string
func (*RoundCreatedMessage) XXX_DiscardUnknown ¶
func (m *RoundCreatedMessage) XXX_DiscardUnknown()
func (*RoundCreatedMessage) XXX_Marshal ¶
func (m *RoundCreatedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RoundCreatedMessage) XXX_Merge ¶
func (m *RoundCreatedMessage) XXX_Merge(src proto.Message)
func (*RoundCreatedMessage) XXX_Size ¶
func (m *RoundCreatedMessage) XXX_Size() int
func (*RoundCreatedMessage) XXX_Unmarshal ¶
func (m *RoundCreatedMessage) XXX_Unmarshal(b []byte) error
type RoundEvent ¶
type RoundEvent struct { Consensus bool `protobuf:"varint,1,opt,name=Consensus,proto3" json:"Consensus,omitempty"` Clotho bool `protobuf:"varint,2,opt,name=Clotho,proto3" json:"Clotho,omitempty"` Atropos Trilean `protobuf:"varint,3,opt,name=Atropos,proto3,enum=poset.Trilean" json:"Atropos,omitempty"` RoundReceived int64 `protobuf:"varint,4,opt,name=RoundReceived,proto3" json:"RoundReceived,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RoundEvent) Descriptor ¶
func (*RoundEvent) Descriptor() ([]byte, []int)
func (*RoundEvent) Equals ¶
func (re *RoundEvent) Equals(that *RoundEvent) bool
Equals compares round events for equality
func (*RoundEvent) GetAtropos ¶
func (m *RoundEvent) GetAtropos() Trilean
func (*RoundEvent) GetClotho ¶
func (m *RoundEvent) GetClotho() bool
func (*RoundEvent) GetConsensus ¶
func (m *RoundEvent) GetConsensus() bool
func (*RoundEvent) GetRoundReceived ¶
func (m *RoundEvent) GetRoundReceived() int64
func (*RoundEvent) ProtoMessage ¶
func (*RoundEvent) ProtoMessage()
func (*RoundEvent) Reset ¶
func (m *RoundEvent) Reset()
func (*RoundEvent) String ¶
func (m *RoundEvent) String() string
func (*RoundEvent) XXX_DiscardUnknown ¶
func (m *RoundEvent) XXX_DiscardUnknown()
func (*RoundEvent) XXX_Marshal ¶
func (m *RoundEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RoundEvent) XXX_Merge ¶
func (m *RoundEvent) XXX_Merge(src proto.Message)
func (*RoundEvent) XXX_Size ¶
func (m *RoundEvent) XXX_Size() int
func (*RoundEvent) XXX_Unmarshal ¶
func (m *RoundEvent) XXX_Unmarshal(b []byte) error
type RoundReceived ¶
type RoundReceived struct { Rounds [][]byte `protobuf:"bytes,1,rep,name=Rounds,proto3" json:"Rounds,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RoundReceived) Descriptor ¶
func (*RoundReceived) Descriptor() ([]byte, []int)
func (*RoundReceived) GetRounds ¶
func (m *RoundReceived) GetRounds() [][]byte
func (*RoundReceived) ProtoMarshal ¶
func (r *RoundReceived) ProtoMarshal() ([]byte, error)
ProtoMarshal serialises the received round using protobuf
func (*RoundReceived) ProtoMessage ¶
func (*RoundReceived) ProtoMessage()
func (*RoundReceived) ProtoUnmarshal ¶
func (r *RoundReceived) ProtoUnmarshal(data []byte) error
ProtoUnmarshal de-serialises RoundReceived using protobuf
func (*RoundReceived) Reset ¶
func (m *RoundReceived) Reset()
func (*RoundReceived) String ¶
func (m *RoundReceived) String() string
func (*RoundReceived) XXX_DiscardUnknown ¶
func (m *RoundReceived) XXX_DiscardUnknown()
func (*RoundReceived) XXX_Marshal ¶
func (m *RoundReceived) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RoundReceived) XXX_Merge ¶
func (m *RoundReceived) XXX_Merge(src proto.Message)
func (*RoundReceived) XXX_Size ¶
func (m *RoundReceived) XXX_Size() int
func (*RoundReceived) XXX_Unmarshal ¶
func (m *RoundReceived) XXX_Unmarshal(b []byte) error
type Store ¶
type Store interface { TopologicalEvents() ([]Event, error) // returns event in topological order CacheSize() int Participants() (*peers.Peers, error) RootsBySelfParent() map[EventHash]Root RootsByParticipant() map[string]Root GetEventBlock(EventHash) (Event, error) SetEvent(Event) error ParticipantEvents(string, int64) (EventHashes, error) ParticipantEvent(string, int64) (EventHash, error) LastEventFrom(string) (EventHash, bool, error) LastConsensusEventFrom(string) (EventHash, bool, error) ConsensusEvents() EventHashes ConsensusEventsCount() int64 AddConsensusEvent(Event) error GetRoundCreated(int64) (RoundCreated, error) SetRoundCreated(int64, RoundCreated) error GetRoundReceived(int64) (RoundReceived, error) SetRoundReceived(int64, RoundReceived) error LastRound() int64 RoundClothos(int64) EventHashes RoundEvents(int64) int GetRoot(string) (Root, error) GetBlock(int64) (Block, error) SetBlock(Block) error LastBlockIndex() int64 GetFrame(int64) (Frame, error) SetFrame(Frame) error Reset(map[string]Root) error Close() error NeedBootstrap() bool // Was the store loaded from existing db StorePath() string // StateDB returns state database StateDB() state.Database StateRoot() hash.Hash }
Store provides an interface for persistent and non-persistent stores to store key lachesis consensus information on a node.
type WireBlockSignature ¶
type WireBlockSignature struct { Index int64 `protobuf:"varint,1,opt,name=Index,proto3" json:"Index,omitempty"` Signature string `protobuf:"bytes,2,opt,name=Signature,proto3" json:"Signature,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*WireBlockSignature) Descriptor ¶
func (*WireBlockSignature) Descriptor() ([]byte, []int)
func (*WireBlockSignature) Equals ¶
func (wbs *WireBlockSignature) Equals(that *WireBlockSignature) bool
Equals compares the equality of wire block signatures
func (*WireBlockSignature) GetIndex ¶
func (m *WireBlockSignature) GetIndex() int64
func (*WireBlockSignature) GetSignature ¶
func (m *WireBlockSignature) GetSignature() string
func (*WireBlockSignature) ProtoMessage ¶
func (*WireBlockSignature) ProtoMessage()
func (*WireBlockSignature) Reset ¶
func (m *WireBlockSignature) Reset()
func (*WireBlockSignature) String ¶
func (m *WireBlockSignature) String() string
func (*WireBlockSignature) XXX_DiscardUnknown ¶
func (m *WireBlockSignature) XXX_DiscardUnknown()
func (*WireBlockSignature) XXX_Marshal ¶
func (m *WireBlockSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WireBlockSignature) XXX_Merge ¶
func (m *WireBlockSignature) XXX_Merge(src proto.Message)
func (*WireBlockSignature) XXX_Size ¶
func (m *WireBlockSignature) XXX_Size() int
func (*WireBlockSignature) XXX_Unmarshal ¶
func (m *WireBlockSignature) XXX_Unmarshal(b []byte) error