Versions in this module Expand all Collapse all v0 v0.0.1 Jan 19, 2022 Changes in this version + const DataChannel + 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 ErrSignatureFoundInPastBlocks = errors.New("found signature from the same key") + var MisbehaviorList = map[string]Misbehavior + func CompareHRS(h1 int64, r1 int32, s1 cstypes.RoundStepType, h2 int64, r2 int32, ...) int + func IsDataCorruptionError(err error) bool + func RunReplayFile(config cfg.BaseConfig, csConfig *cfg.ConsensusConfig, console bool) + func WALFromProto(msg *tmcons.WALMessage) (tmcon.WALMessage, error) + func WALGenerateNBlocks(t *testing.T, wr io.Writer, numBlocks int) (err error) + func WALToProto(msg tmcon.WALMessage) (*tmcons.WALMessage, error) + func WALWithNBlocks(t *testing.T, numBlocks int) (data []byte, err error) + type BaseWAL struct + func NewWAL(walFile string, groupOptions ...func(*auto.Group)) (*BaseWAL, error) + func (wal *BaseWAL) FlushAndSync() error + func (wal *BaseWAL) Group() *auto.Group + func (wal *BaseWAL) OnStart() error + func (wal *BaseWAL) OnStop() + func (wal *BaseWAL) SearchForEndHeight(height int64, options *tmcon.WALSearchOptions) (rd io.ReadCloser, found bool, err error) + func (wal *BaseWAL) SetFlushInterval(i time.Duration) + func (wal *BaseWAL) SetLogger(l log.Logger) + func (wal *BaseWAL) Wait() + func (wal *BaseWAL) Write(msg tmcon.WALMessage) error + func (wal *BaseWAL) WriteSync(msg tmcon.WALMessage) error + type DataCorruptionError struct + func (e DataCorruptionError) Cause() error + func (e DataCorruptionError) Error() string + type Handshaker struct + func NewHandshaker(stateStore sm.Store, state sm.State, store sm.BlockStore, ...) *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 Misbehavior struct + EnterPrecommit func(cs *State, height int64, round int32) + EnterPrevote func(cs *State, height int64, round int32) + EnterPropose func(cs *State, height int64, round int32) + Name string + ReceivePrecommit func(cs *State, precommit *types.Vote) + ReceivePrevote func(cs *State, prevote *types.Vote) + ReceiveProposal func(cs *State, proposal *types.Proposal) error + func DefaultMisbehavior() Misbehavior + func DoublePrevoteMisbehavior() Misbehavior + type PeerState struct + PRS cstypes.PeerRoundState + Stats *peerStateStats + func NewPeerState(peer p2p.Peer) *PeerState + func (ps *PeerState) ApplyHasVoteMessage(msg *tmcon.HasVoteMessage) + func (ps *PeerState) ApplyNewRoundStepMessage(msg *tmcon.NewRoundStepMessage) + func (ps *PeerState) ApplyNewValidBlockMessage(msg *tmcon.NewValidBlockMessage) + func (ps *PeerState) ApplyProposalPOLMessage(msg *tmcon.ProposalPOLMessage) + func (ps *PeerState) ApplyVoteSetBitsMessage(msg *tmcon.VoteSetBitsMessage, ourVotes *bits.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(partSetHeader 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 int32, 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 Reactor struct + Metrics *tmcon.Metrics + func NewReactor(consensusState *State, waitSync bool, options ...ReactorOption) *Reactor + func (conR *Reactor) AddPeer(peer p2p.Peer) + func (conR *Reactor) GetChannels() []*p2p.ChannelDescriptor + func (conR *Reactor) InitPeer(peer p2p.Peer) p2p.Peer + func (conR *Reactor) OnStart() error + func (conR *Reactor) OnStop() + func (conR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) + func (conR *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) + func (conR *Reactor) SetEventBus(b *types.EventBus) + func (conR *Reactor) String() string + func (conR *Reactor) StringIndented(indent string) string + func (conR *Reactor) SwitchToConsensus(state sm.State, skipWAL bool) + func (conR *Reactor) WaitSync() bool + type ReactorOption func(*Reactor) + func ReactorMetrics(metrics *tmcon.Metrics) ReactorOption + type State struct + func NewState(config *cfg.ConsensusConfig, state sm.State, blockExec *sm.BlockExecutor, ...) *State + func (cs *State) AddProposalBlockPart(height int64, round int32, part *types.Part, peerID p2p.ID) error + func (cs *State) AddVote(vote *types.Vote, peerID p2p.ID) (added bool, err error) + func (cs *State) GetLastHeight() int64 + func (cs *State) GetRoundState() *cstypes.RoundState + func (cs *State) GetRoundStateJSON() ([]byte, error) + func (cs *State) GetRoundStateSimpleJSON() ([]byte, error) + func (cs *State) GetState() sm.State + func (cs *State) GetValidators() (int64, []*types.Validator) + func (cs *State) LoadCommit(height int64) *types.Commit + func (cs *State) OnStart() error + func (cs *State) OnStop() + func (cs *State) OpenWAL(walFile string) (tmcon.WAL, error) + func (cs *State) ReplayFile(file string, console bool) error + func (cs *State) SetEventBus(b *types.EventBus) + func (cs *State) SetLogger(l log.Logger) + func (cs *State) SetPrivValidator(priv types.PrivValidator) + func (cs *State) SetProposal(proposal *types.Proposal, peerID p2p.ID) error + func (cs *State) SetProposalAndBlock(proposal *types.Proposal, block *types.Block, parts *types.PartSet, ...) error + func (cs *State) SetSwitch(sw *p2p.Switch) + func (cs *State) SetTimeoutTicker(timeoutTicker TimeoutTicker) + func (cs *State) String() string + func (cs *State) Wait() + type StateOption func(*State) + func StateMetrics(metrics *tmcon.Metrics) StateOption + 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 WALDecoder struct + func NewWALDecoder(rd io.Reader) *WALDecoder + func (dec *WALDecoder) Decode() (*tmcon.TimedWALMessage, error) + type WALEncoder struct + func NewWALEncoder(wr io.Writer) *WALEncoder + func (enc *WALEncoder) Encode(v *tmcon.TimedWALMessage) error + type WALSearchOptions struct + IgnoreDataCorruptionErrors bool