Versions in this module Expand all Collapse all v1 v1.1.3 Feb 13, 2020 Changes in this version + const DataChannel + const Start + const StateChannel + const Stop + const Switch + const VoteChannel + const VoteSetBitsChannel + var ErrAddingVote = errors.New("error adding vote") + var ErrInvalidProposalPOLRound = errors.New("error invalid proposal POL round") + var ErrInvalidProposalSignature = errors.New("error invalid proposal signature") + var ErrVoteHeightMismatch = errors.New("error vote height mismatch") + func CompareHRS(h1 uint64, r1 uint, s1 ttypes.RoundStepType, h2 uint64, r2 uint, ...) int + func MakeValidators(cmm *types.CommitteeInfo) *ttypes.ValidatorSet + func RegisterConsensusMessages(cdc *amino.Codec) + type BlockPartMessage struct + Height uint64 + Part *ttypes.Part + Round uint + func (m *BlockPartMessage) String() string + type CSOption func(*ConsensusState) + type CommitStepMessage struct + BlockParts *help.BitArray + BlockPartsHeader ttypes.PartSetHeader + Height uint64 + func (m *CommitStepMessage) String() string + type ConsensusMessage interface + type ConsensusReactor struct + func NewConsensusReactor(consensusState *ConsensusState, fastSync bool) *ConsensusReactor + func (conR *ConsensusReactor) AddPeer(peer tp2p.Peer) + func (conR *ConsensusReactor) FastSync() bool + func (conR *ConsensusReactor) GetChannels() []*tp2p.ChannelDescriptor + func (conR *ConsensusReactor) OnStart() error + func (conR *ConsensusReactor) OnStop() + func (conR *ConsensusReactor) Receive(chID byte, src tp2p.Peer, msgBytes []byte) + func (conR *ConsensusReactor) RemovePeer(peer tp2p.Peer, reason interface{}) + func (conR *ConsensusReactor) SetEventBus(b *ttypes.EventBus) + func (conR *ConsensusReactor) SetHealthMgr(h *ttypes.HealthMgr) + func (conR *ConsensusReactor) String() string + func (conR *ConsensusReactor) StringIndented(indent string) string + type ConsensusState struct + func NewConsensusState(config *cfg.ConsensusConfig, state ttypes.StateAgent, store *ttypes.BlockStore, ...) *ConsensusState + func (cs *ConsensusState) AddProposalBlockPart(height uint64, round uint, part *ttypes.Part, peerID string) error + func (cs *ConsensusState) AddVote(vote *ttypes.Vote, peerID string) (added bool, err error) + func (cs *ConsensusState) GetRoundState() *ttypes.RoundState + func (cs *ConsensusState) GetRoundStateJSON() ([]byte, error) + func (cs *ConsensusState) GetRoundStateSimpleJSON() ([]byte, error) + func (cs *ConsensusState) OnStart() error + func (cs *ConsensusState) OnStop() + func (cs *ConsensusState) SetCommitteeInfo(c *types.CommitteeInfo) + func (cs *ConsensusState) SetEventBus(b *ttypes.EventBus) + func (cs *ConsensusState) SetHealthMgr(h *ttypes.HealthMgr) + func (cs *ConsensusState) SetLogger(l log.Logger) + func (cs *ConsensusState) SetPrivValidator(priv ttypes.PrivValidator) + func (cs *ConsensusState) SetProposal(proposal *ttypes.Proposal, peerID string) error + func (cs *ConsensusState) SetProposalAndBlock(proposal *ttypes.Proposal, block *types.Block, parts *ttypes.PartSet, ...) error + func (cs *ConsensusState) SetTimeoutTicker(timeoutTicker TimeoutTicker) + func (cs *ConsensusState) String() string + func (cs *ConsensusState) UpdateValidatorsSet(vset *ttypes.ValidatorSet, uHeight, eHeight uint64) + func (cs *ConsensusState) Wait() + type HasVoteMessage struct + Height uint64 + Index uint + Round uint + Type byte + func (m *HasVoteMessage) String() string + type NewRoundStepMessage struct + Height uint64 + LastCommitRound uint + Round uint + SecondsSinceStartTime uint + Step ttypes.RoundStepType + func (m *NewRoundStepMessage) String() string + type Node struct + Agent types.PbftAgentProxy + func NewNode(config *cfg.TbftConfig, chainID string, priv *ecdsa.PrivateKey, ...) (*Node, error) + func (n *Node) AddHealthForCommittee(h *ttypes.HealthMgr, c *types.CommitteeInfo) + func (n *Node) GetCommitteeStatus(committeeID *big.Int) map[string]interface{} + func (n *Node) IsLeader(committeeID *big.Int) bool + func (n *Node) Notify(id *big.Int, action int) error + func (n *Node) OnStart() error + func (n *Node) OnStop() + func (n *Node) PutCommittee(committeeInfo *types.CommitteeInfo) error + func (n *Node) PutNodes(id *big.Int, nodes []*types.CommitteeNode) error + func (n *Node) RunForever() + func (n *Node) SetCommitteeStop(committeeID *big.Int, stop uint64) error + func (n *Node) UpdateCommittee(info *types.CommitteeInfo) error + type PeerState struct + PRS ttypes.PeerRoundState + Stats *peerStateStats + func NewPeerState(peer tp2p.Peer) *PeerState + func (ps *PeerState) ApplyCommitStepMessage(msg *CommitStepMessage) + func (ps *PeerState) ApplyHasVoteMessage(msg *HasVoteMessage) + func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) + func (ps *PeerState) ApplyProposalPOLMessage(msg *ProposalPOLMessage) + func (ps *PeerState) ApplyVoteSetBitsMessage(msg *VoteSetBitsMessage, ourVotes *help.BitArray) + func (ps *PeerState) BlockPartsSent() uint + func (ps *PeerState) EnsureVoteBitArrays(height uint64, numValidators uint) + func (ps *PeerState) GetHeight() uint64 + func (ps *PeerState) GetRoundState() *ttypes.PeerRoundState + func (ps *PeerState) InitProposalBlockParts(partsHeader ttypes.PartSetHeader) + func (ps *PeerState) PickSendVote(votes ttypes.VoteSetReader) bool + func (ps *PeerState) PickVoteToSend(votes ttypes.VoteSetReader) (vote *ttypes.Vote, ok bool) + func (ps *PeerState) RecordBlockPart(bp *BlockPartMessage) uint + func (ps *PeerState) RecordVote(vote *ttypes.Vote) uint + func (ps *PeerState) SetHasProposal(proposal *ttypes.Proposal) + func (ps *PeerState) SetHasProposalBlockPart(height uint64, round uint, index uint) + func (ps *PeerState) SetHasVote(vote *ttypes.Vote) + func (ps *PeerState) SetLogger(logger log.Logger) *PeerState + func (ps *PeerState) String() string + func (ps *PeerState) StringIndented(indent string) string + func (ps *PeerState) ToJSON() ([]byte, error) + func (ps *PeerState) VotesSent() uint + type ProposalMessage struct + Proposal *ttypes.Proposal + func (m *ProposalMessage) String() string + type ProposalPOLMessage struct + Height uint64 + ProposalPOL *help.BitArray + ProposalPOLRound uint + func (m *ProposalPOLMessage) String() string + type TimeoutTicker interface + Chan func() <-chan timeoutInfo + ScheduleTimeout func(ti timeoutInfo) + Start func() error + Stop func() error + func NewTimeoutTicker(name string) TimeoutTicker + type ValidatorUpdateMessage struct + func (v *ValidatorUpdateMessage) String() string + type VoteMessage struct + Vote *ttypes.Vote + func (m *VoteMessage) String() string + type VoteSetBitsMessage struct + BlockID ttypes.BlockID + Height uint64 + Round uint + Type byte + Votes *help.BitArray + func (m *VoteSetBitsMessage) String() string + type VoteSetMaj23Message struct + BlockID ttypes.BlockID + Height uint64 + Round uint + Type byte + func (m *VoteSetMaj23Message) String() string