Versions in this module Expand all Collapse all v0 v0.0.9 Aug 14, 2020 v0.0.9-Bytes01 Aug 18, 2020 v0.0.9-Bytes Aug 18, 2020 v0.0.8 Aug 14, 2020 Changes in this version + const HotStuffMessageTypeRoot + type Block struct + Id string + ParentQC *QC + Payload string + Round int64 + func (b Block) String() string + func (z *Block) DecodeMsg(dc *msgp.Reader) (err error) + func (z *Block) EncodeMsg(en *msgp.Writer) (err error) + func (z *Block) MarshalMsg(b []byte) (o []byte, err error) + func (z *Block) Msgsize() (s int) + func (z *Block) UnmarshalMsg(bts []byte) (o []byte, err error) + type Committee struct + Peers []*CommitteeMember + Version int + type CommitteeMember struct + ConsensusAccount ConsensusAccount + MemberId string + PeerIndex int + TransportPeerId string + type CommitteeProvider interface + AmIIn func() bool + AmILeader func(round int64) bool + GetAllMemberPeedIds func() []string + GetAllMemberTransportIds func() []string + GetAllMembers func() []CommitteeMember + GetLeader func(round int64) CommitteeMember + GetMyPeerId func() string + GetMyPeerIndex func() int + GetPeerIndex func(id string) (index int, err error) + GetThreshold func() int + GetVersion func() int + InitCommittee func(version int, peers []CommitteeMember, myAccount ConsensusAccount) + IsIn func(id string) bool + type ConsensusAccount interface + Id func() string + type ConsensusAccountProvider interface + Generate func() (account ConsensusAccount, err error) + Load func() (account ConsensusAccount, err error) + ProvideAccount func() (ConsensusAccount, error) + Save func() (err error) + type ConsensusSigner interface + Sign func(msg []byte, account ConsensusAccount) Signature + type ConsensusState struct + HighQC *QC + LastTC *TC + LastVoteRound int64 + PreferredRound int64 + func (c ConsensusState) String() string + type ContentProposal struct + Proposal Block + TC *TC + func (z *ContentProposal) DecodeMsg(dc *msgp.Reader) (err error) + func (z *ContentProposal) EncodeMsg(en *msgp.Writer) (err error) + func (z *ContentProposal) FromBytes(bts []byte) error + func (z *ContentProposal) MarshalMsg(b []byte) (o []byte, err error) + func (z *ContentProposal) Msgsize() (s int) + func (z *ContentProposal) SignatureTarget() []byte + func (z *ContentProposal) String() string + func (z *ContentProposal) ToBytes() []byte + func (z *ContentProposal) UnmarshalMsg(bts []byte) (o []byte, err error) + type ContentString struct + Content string + func (z *ContentString) DecodeMsg(dc *msgp.Reader) (err error) + func (z *ContentString) FromBytes(bts []byte) error + func (z *ContentString) SignatureTarget() []byte + func (z *ContentString) String() string + func (z *ContentString) ToBytes() []byte + func (z *ContentString) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z ContentString) EncodeMsg(en *msgp.Writer) (err error) + func (z ContentString) MarshalMsg(b []byte) (o []byte, err error) + func (z ContentString) Msgsize() (s int) + type ContentTimeout struct + HighQC *QC + Round int64 + TC *TC + func (z *ContentTimeout) DecodeMsg(dc *msgp.Reader) (err error) + func (z *ContentTimeout) EncodeMsg(en *msgp.Writer) (err error) + func (z *ContentTimeout) FromBytes(bts []byte) error + func (z *ContentTimeout) MarshalMsg(b []byte) (o []byte, err error) + func (z *ContentTimeout) Msgsize() (s int) + func (z *ContentTimeout) SignatureTarget() []byte + func (z *ContentTimeout) String() string + func (z *ContentTimeout) ToBytes() []byte + func (z *ContentTimeout) UnmarshalMsg(bts []byte) (o []byte, err error) + type ContentVote struct + LedgerCommitInfo LedgerCommitInfo + QC *QC + TC *TC + VoteInfo VoteInfo + func (z *ContentVote) DecodeMsg(dc *msgp.Reader) (err error) + func (z *ContentVote) EncodeMsg(en *msgp.Writer) (err error) + func (z *ContentVote) FromBytes(bts []byte) error + func (z *ContentVote) MarshalMsg(b []byte) (o []byte, err error) + func (z *ContentVote) Msgsize() (s int) + func (z *ContentVote) SignatureTarget() []byte + func (z *ContentVote) String() string + func (z *ContentVote) ToBytes() []byte + func (z *ContentVote) UnmarshalMsg(bts []byte) (o []byte, err error) + type ExecutionResult struct + BlockId string + Err error + ExecuteStateId string + func (e *ExecutionResult) String() string + type Hasher interface + Hash func(s string) string + type HotStuffMessageType int + const HotStuffMessageTypeProposal + const HotStuffMessageTypeString + const HotStuffMessageTypeTimeout + const HotStuffMessageTypeVote + func (m HotStuffMessageType) String() string + func (z *HotStuffMessageType) DecodeMsg(dc *msgp.Reader) (err error) + func (z *HotStuffMessageType) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z HotStuffMessageType) EncodeMsg(en *msgp.Writer) (err error) + func (z HotStuffMessageType) MarshalMsg(b []byte) (o []byte, err error) + func (z HotStuffMessageType) Msgsize() (s int) + type HotStuffSignedMessage struct + ContentBytes []byte + HotStuffMessageType int + SenderMemberId string + Signature []byte + func (z *HotStuffSignedMessage) DecodeMsg(dc *msgp.Reader) (err error) + func (z *HotStuffSignedMessage) EncodeMsg(en *msgp.Writer) (err error) + func (z *HotStuffSignedMessage) FromBytes(bts []byte) error + func (z *HotStuffSignedMessage) GetTypeValue() int + func (z *HotStuffSignedMessage) MarshalMsg(b []byte) (o []byte, err error) + func (z *HotStuffSignedMessage) Msgsize() (s int) + func (z *HotStuffSignedMessage) String() string + func (z *HotStuffSignedMessage) ToBytes() []byte + func (z *HotStuffSignedMessage) UnmarshalMsg(bts []byte) (o []byte, err error) + type JointSignature []byte + func (z *JointSignature) DecodeMsg(dc *msgp.Reader) (err error) + func (z *JointSignature) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z JointSignature) EncodeMsg(en *msgp.Writer) (err error) + func (z JointSignature) MarshalMsg(b []byte) (o []byte, err error) + func (z JointSignature) Msgsize() (s int) + type Ledger interface + Commit func(blockId string) + CurrentCommittee func() *Committee + CurrentHeight func() int64 + GetConsensusState func() *ConsensusState + GetState func(blockId string) (stateId string) + SaveConsensusState func(*ConsensusState) + Speculate func(prevBlockId string, block *Block) (executionResult ExecutionResult) + type LedgerCommitInfo struct + CommitStateId string + VoteInfoHash string + func (l LedgerCommitInfo) GetHashContent() string + func (l LedgerCommitInfo) String() string + func (z *LedgerCommitInfo) DecodeMsg(dc *msgp.Reader) (err error) + func (z *LedgerCommitInfo) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z LedgerCommitInfo) EncodeMsg(en *msgp.Writer) (err error) + func (z LedgerCommitInfo) MarshalMsg(b []byte) (o []byte, err error) + func (z LedgerCommitInfo) Msgsize() (s int) + type ProposalContext struct + CurrentRound int64 + HighQC *QC + TC *TC + func (p ProposalContext) String() string + type ProposalContextProvider interface + GetProposalContext func() *ProposalContext + type ProposalExecutor interface + ExecuteProposal func(block *Block) (executionResult ExecutionResult) + ExecuteProposalAsync func(block *Block) + type ProposalGenerator interface + GenerateProposal func(context *ProposalContext) *ContentProposal + GenerateProposalAsync func(context *ProposalContext, callback func(*ContentProposal)) + type ProposalVerifier interface + VerifyProposal func(proposal *ContentProposal) *VerifyResult + VerifyProposalAsync func(proposal *ContentProposal) + type QC struct + JointSignature JointSignature + VoteData VoteInfo + func (q *QC) String() string + func (z *QC) DecodeMsg(dc *msgp.Reader) (err error) + func (z *QC) EncodeMsg(en *msgp.Writer) (err error) + func (z *QC) MarshalMsg(b []byte) (o []byte, err error) + func (z *QC) Msgsize() (s int) + func (z *QC) UnmarshalMsg(bts []byte) (o []byte, err error) + type Signature []byte + func (z *Signature) DecodeMsg(dc *msgp.Reader) (err error) + func (z *Signature) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z Signature) EncodeMsg(en *msgp.Writer) (err error) + func (z Signature) MarshalMsg(b []byte) (o []byte, err error) + func (z Signature) Msgsize() (s int) + type SignatureCollector interface + Collect func(sig Signature, index int) + Collected func() bool + GetCurrentCount func() int + GetJointSignature func() JointSignature + GetSignature func(index int) (v Signature, ok bool) + GetThreshold func() int + Has func(index int) bool + type TC struct + JointSignature JointSignature + Round int64 + func (t *TC) String() string + func (z *TC) DecodeMsg(dc *msgp.Reader) (err error) + func (z *TC) EncodeMsg(en *msgp.Writer) (err error) + func (z *TC) MarshalMsg(b []byte) (o []byte, err error) + func (z *TC) Msgsize() (s int) + func (z *TC) UnmarshalMsg(bts []byte) (o []byte, err error) + type VerifyResult struct + Ok bool + type VoteInfo struct + ExecStateId string + GrandParentId string + GrandParentRound int64 + Id string + ParentId string + ParentRound int64 + Round int64 + func (i VoteInfo) GetHashContent() string + func (i VoteInfo) String() string + func (z *VoteInfo) DecodeMsg(dc *msgp.Reader) (err error) + func (z *VoteInfo) EncodeMsg(en *msgp.Writer) (err error) + func (z *VoteInfo) MarshalMsg(b []byte) (o []byte, err error) + func (z *VoteInfo) Msgsize() (s int) + func (z *VoteInfo) UnmarshalMsg(bts []byte) (o []byte, err error)