Versions in this module Expand all Collapse all v0 v0.9.0 Oct 19, 2020 Changes in this version + const DataChannel + const MetricsSubsystem + const StateChannel + 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 ErrPeerStateHeightRegression = errors.New("Error peer state height regression") + var ErrPeerStateInvalidStartTime = errors.New("Error peer state invalid startTime") + var ErrVoteHeightMismatch = errors.New("Error vote height mismatch") + func CompareHRS(h1 int64, r1 int, s1 cstypes.RoundStepType, h2 int64, r2 int, ...) int + func IsDataCorruptionError(err error) bool + func NewWAL(walFile string, groupOptions ...func(*auto.Group)) (*baseWAL, error) + func RegisterConsensusMessages(cdc *amino.Codec) + func RegisterWALMessages(cdc *amino.Codec) + func RunReplayFile(config cfg.BaseConfig, csConfig *cfg.ConsensusConfig, console bool) + func WALGenerateNBlocks(t *testing.T, wr io.Writer, numBlocks int) (err error) + func WALWithNBlocks(t *testing.T, numBlocks int) (data []byte, err error) + type BlockPartMessage struct + Height int64 + Part *types.Part + Round int + func (m *BlockPartMessage) String() string + func (m *BlockPartMessage) ValidateBasic() error + type ConsensusMessage interface + ValidateBasic func() error + type ConsensusReactor struct + func NewConsensusReactor(consensusState *ConsensusState, fastSync bool, options ...ReactorOption) *ConsensusReactor + func (conR *ConsensusReactor) AddPeer(peer p2p.Peer) + func (conR *ConsensusReactor) FastSync() bool + func (conR *ConsensusReactor) GetChannels() []*p2p.ChannelDescriptor + func (conR *ConsensusReactor) InitPeer(peer p2p.Peer) p2p.Peer + func (conR *ConsensusReactor) OnStart() error + func (conR *ConsensusReactor) OnStop() + func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) + func (conR *ConsensusReactor) RemovePeer(peer p2p.Peer, reason interface{}) + func (conR *ConsensusReactor) SetEventBus(b *types.EventBus) + func (conR *ConsensusReactor) String() string + func (conR *ConsensusReactor) StringIndented(indent string) string + func (conR *ConsensusReactor) SwitchToConsensus(state sm.State, blocksSynced int) + type ConsensusState struct + func NewConsensusState(config *cfg.ConsensusConfig, state sm.State, blockExec *sm.BlockExecutor, ...) *ConsensusState + func (cs *ConsensusState) AddProposalBlockPart(height int64, round int, part *types.Part, peerID p2p.ID) error + func (cs *ConsensusState) AddVote(vote *types.Vote, peerID p2p.ID) (added bool, err error) + func (cs *ConsensusState) GetLastHeight() int64 + func (cs *ConsensusState) GetRoundState() *cstypes.RoundState + func (cs *ConsensusState) GetRoundStateJSON() ([]byte, error) + func (cs *ConsensusState) GetRoundStateSimpleJSON() ([]byte, error) + func (cs *ConsensusState) GetState() sm.State + func (cs *ConsensusState) GetValidators() (int64, []*types.Validator) + func (cs *ConsensusState) LoadCommit(height int64) *types.Commit + func (cs *ConsensusState) OnStart() error + func (cs *ConsensusState) OnStop() + func (cs *ConsensusState) OpenWAL(walFile string) (WAL, error) + func (cs *ConsensusState) ReplayFile(file string, console bool) error + func (cs *ConsensusState) SetEventBus(b *types.EventBus) + func (cs *ConsensusState) SetLogger(l log.Logger) + func (cs *ConsensusState) SetPrivValidator(priv types.PrivValidator) + func (cs *ConsensusState) SetProposal(proposal *types.Proposal, peerID p2p.ID) error + func (cs *ConsensusState) SetProposalAndBlock(proposal *types.Proposal, block *types.Block, parts *types.PartSet, ...) error + func (cs *ConsensusState) SetTimeoutTicker(timeoutTicker TimeoutTicker) + func (cs *ConsensusState) String() string + func (cs *ConsensusState) Wait() + type DataCorruptionError struct + func (e DataCorruptionError) Cause() error + func (e DataCorruptionError) Error() string + type EndHeightMessage struct + Height int64 + type Handshaker struct + func NewHandshaker(stateDB dbm.DB, state sm.State, store sm.BlockStore, genDoc *types.GenesisDoc) *Handshaker + func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error + func (h *Handshaker) NBlocks() int + func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight int64, proxyApp proxy.AppConns) ([]byte, error) + func (h *Handshaker) SetEventBus(eventBus types.BlockEventPublisher) + func (h *Handshaker) SetLogger(l log.Logger) + type HasVoteMessage struct + Height int64 + Index int + Round int + Type types.SignedMsgType + func (m *HasVoteMessage) String() string + func (m *HasVoteMessage) ValidateBasic() error + type Metrics struct + BlockIntervalSeconds metrics.Gauge + BlockParts metrics.Counter + BlockSizeBytes metrics.Gauge + ByzantineValidators metrics.Gauge + ByzantineValidatorsPower metrics.Gauge + CommittedHeight metrics.Gauge + FastSyncing metrics.Gauge + Height metrics.Gauge + MissingValidators metrics.Gauge + MissingValidatorsPower metrics.Gauge + NumTxs metrics.Gauge + Rounds metrics.Gauge + TotalTxs metrics.Gauge + Validators metrics.Gauge + ValidatorsPower metrics.Gauge + func NopMetrics() *Metrics + func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics + type NewRoundStepMessage struct + Height int64 + LastCommitRound int + Round int + SecondsSinceStartTime int + Step cstypes.RoundStepType + func (m *NewRoundStepMessage) String() string + func (m *NewRoundStepMessage) ValidateBasic() error + type NewValidBlockMessage struct + BlockParts *cmn.BitArray + BlockPartsHeader types.PartSetHeader + Height int64 + IsCommit bool + Round int + func (m *NewValidBlockMessage) String() string + func (m *NewValidBlockMessage) ValidateBasic() error + type PeerState struct + PRS cstypes.PeerRoundState + Stats *peerStateStats + func NewPeerState(peer p2p.Peer) *PeerState + func (ps *PeerState) ApplyHasVoteMessage(msg *HasVoteMessage) + func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) + func (ps *PeerState) ApplyNewValidBlockMessage(msg *NewValidBlockMessage) + func (ps *PeerState) ApplyProposalPOLMessage(msg *ProposalPOLMessage) + func (ps *PeerState) ApplyVoteSetBitsMessage(msg *VoteSetBitsMessage, ourVotes *cmn.BitArray) + func (ps *PeerState) BlockPartsSent() int + func (ps *PeerState) EnsureVoteBitArrays(height int64, numValidators int) + func (ps *PeerState) GetHeight() int64 + func (ps *PeerState) GetRoundState() *cstypes.PeerRoundState + func (ps *PeerState) InitProposalBlockParts(partsHeader types.PartSetHeader) + func (ps *PeerState) PickSendVote(votes types.VoteSetReader) bool + func (ps *PeerState) PickVoteToSend(votes types.VoteSetReader) (vote *types.Vote, ok bool) + func (ps *PeerState) RecordBlockPart() int + func (ps *PeerState) RecordVote() int + func (ps *PeerState) SetHasProposal(proposal *types.Proposal) + func (ps *PeerState) SetHasProposalBlockPart(height int64, round int, index int) + func (ps *PeerState) SetHasVote(vote *types.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() int + type ProposalMessage struct + Proposal *types.Proposal + func (m *ProposalMessage) String() string + func (m *ProposalMessage) ValidateBasic() error + type ProposalPOLMessage struct + Height int64 + ProposalPOL *cmn.BitArray + ProposalPOLRound int + func (m *ProposalPOLMessage) String() string + func (m *ProposalPOLMessage) ValidateBasic() error + type ReactorOption func(*ConsensusReactor) + func ReactorMetrics(metrics *Metrics) ReactorOption + type StateOption func(*ConsensusState) + func StateMetrics(metrics *Metrics) StateOption + type TimedWALMessage struct + Msg WALMessage + Time time.Time + type TimeoutTicker interface + Chan func() <-chan timeoutInfo + ScheduleTimeout func(ti timeoutInfo) + SetLogger func(log.Logger) + Start func() error + Stop func() error + func NewTimeoutTicker() TimeoutTicker + type VoteMessage struct + Vote *types.Vote + func (m *VoteMessage) String() string + func (m *VoteMessage) ValidateBasic() error + type VoteSetBitsMessage struct + BlockID types.BlockID + Height int64 + Round int + Type types.SignedMsgType + Votes *cmn.BitArray + func (m *VoteSetBitsMessage) String() string + func (m *VoteSetBitsMessage) ValidateBasic() error + type VoteSetMaj23Message struct + BlockID types.BlockID + Height int64 + Round int + Type types.SignedMsgType + func (m *VoteSetMaj23Message) String() string + func (m *VoteSetMaj23Message) ValidateBasic() error + type WAL interface + FlushAndSync func() error + SearchForEndHeight func(height int64, options *WALSearchOptions) (rd io.ReadCloser, found bool, err error) + Start func() error + Stop func() error + Wait func() + Write func(WALMessage) error + WriteSync func(WALMessage) error + type WALDecoder struct + func NewWALDecoder(rd io.Reader) *WALDecoder + func (dec *WALDecoder) Decode() (*TimedWALMessage, error) + type WALEncoder struct + func NewWALEncoder(wr io.Writer) *WALEncoder + func (enc *WALEncoder) Encode(v *TimedWALMessage) error + type WALMessage interface + type WALSearchOptions struct + IgnoreDataCorruptionErrors bool