Documentation ¶
Index ¶
- Constants
- Variables
- func DecodePatch(t string, bs []byte) (module.Patch, error)
- func IsCorruptedWAL(err error) bool
- func IsEOF(err error) bool
- func IsNotExist(err error) bool
- func IsUnexpectedEOF(err error) bool
- func New(c base.Chain, walDir string, wm WALManager, timestamper module.Timestamper, ...) *consensus
- func NewCommitVoteList(msgs ...*voteMessage) module.CommitVoteSet
- func NewCommitVoteSetFromBytes(bs []byte) module.CommitVoteSet
- func NewConsensus(c base.Chain, walDir string, timestamper module.Timestamper, ...) module.Consensus
- func NewEmptyCommitVoteList() module.CommitVoteSet
- func NewPrecommitMessage(w module.Wallet, height int64, round int32, id []byte, partSetID *PartSetID, ...) *voteMessage
- func NewVoteMessage(w module.Wallet, voteType VoteType, height int64, round int32, id []byte, ...) *voteMessage
- func ResetWAL(height int64, dir string) error
- func WALReadObject(w WALReader, v interface{}) ([]byte, error)
- func WALWriteObject(w WALWriter, v interface{}) error
- type BlockPartMessage
- type Engine
- type LastVoteData
- type Message
- type Part
- type PartSet
- type PartSetBuffer
- type PartSetID
- type ProposalMessage
- type RoundStateMessage
- type Syncer
- type VoteItem
- type VoteSet
- type VoteType
- type WALConfig
- type WALManager
- type WALReader
- type WALWriter
Constants ¶
View Source
const ( ConfigEnginePriority = 2 ConfigSyncerPriority = 3 )
View Source
const ( ProtoProposal module.ProtocolInfo = iota << 8 ProtoBlockPart ProtoVote ProtoRoundState ProtoVoteList )
Variables ¶
View Source
var CsProtocols = []module.ProtocolInfo{ ProtoProposal, ProtoBlockPart, ProtoVote, ProtoVoteList, }
View Source
var SyncerProtocols = []module.ProtocolInfo{ ProtoBlockPart, ProtoRoundState, ProtoVoteList, }
Functions ¶
func IsCorruptedWAL ¶
func IsNotExist ¶
func IsUnexpectedEOF ¶
func New ¶ added in v0.9.10
func New( c base.Chain, walDir string, wm WALManager, timestamper module.Timestamper, bpp fastsync.BlockProofProvider, lastVoteData *LastVoteData, ) *consensus
func NewCommitVoteList ¶ added in v0.9.10
func NewCommitVoteList(msgs ...*voteMessage) module.CommitVoteSet
func NewCommitVoteSetFromBytes ¶
func NewCommitVoteSetFromBytes(bs []byte) module.CommitVoteSet
NewCommitVoteSetFromBytes returns VoteList from serialized bytes
func NewConsensus ¶
func NewConsensus( c base.Chain, walDir string, timestamper module.Timestamper, bpp fastsync.BlockProofProvider, ) module.Consensus
func NewEmptyCommitVoteList ¶ added in v0.9.10
func NewEmptyCommitVoteList() module.CommitVoteSet
func NewPrecommitMessage ¶ added in v0.9.10
func NewVoteMessage ¶ added in v0.9.10
func WALReadObject ¶ added in v0.9.10
func WALWriteObject ¶ added in v0.9.10
Types ¶
type BlockPartMessage ¶ added in v0.9.10
type BlockPartMessage struct { // V1 Fields // for debugging Height int64 Index uint16 BlockPart []byte // V2 Fields Nonce int32 }
func (*BlockPartMessage) String ¶ added in v0.9.10
func (msg *BlockPartMessage) String() string
func (*BlockPartMessage) Verify ¶ added in v0.9.10
func (msg *BlockPartMessage) Verify() error
type Engine ¶
type Engine interface { fastsync.BlockProofProvider GetCommitBlockParts(h int64) PartSet GetCommitPrecommits(h int64) *voteList GetPrecommits(r int32) *voteList // GetVotes returns union of a set of prevotes pv(i) where // pvMask.Get(i) == 0 and a set of precommits pc(i) where // pcMask.Get(i) == 0. For example, if the all bits for mask is 1, // no votes are returned. GetVotes(r int32, pvMask *bitArray, pcMask *bitArray) *voteList GetRoundState() *peerRoundState Height() int64 Round() int32 Step() step ReceiveBlockPartMessage(msg *BlockPartMessage, unicast bool) (int, error) ReceiveVoteListMessage(msg *voteListMessage, unicast bool) error ReceiveBlock(br fastsync.BlockResult) }
type LastVoteData ¶ added in v0.9.10
type Message ¶ added in v0.9.10
type Message interface { Verify() error // contains filtered or unexported methods }
type PartSet ¶
type PartSet interface { ID() *PartSetID Parts() int GetPart(int) Part IsComplete() bool NewReader() io.Reader AddPart(Part) error GetMask() *bitArray }
func NewPartSetFromID ¶ added in v0.9.10
type PartSetBuffer ¶
type ProposalMessage ¶ added in v0.9.10
type ProposalMessage struct {
// contains filtered or unexported fields
}
func NewProposalMessage ¶ added in v0.9.10
func NewProposalMessage() *ProposalMessage
func (*ProposalMessage) String ¶ added in v0.9.10
func (msg *ProposalMessage) String() string
func (*ProposalMessage) Verify ¶ added in v0.9.10
func (msg *ProposalMessage) Verify() error
type RoundStateMessage ¶ added in v0.9.10
type RoundStateMessage struct { Timestamp int64 // contains filtered or unexported fields }
func (RoundStateMessage) String ¶ added in v0.9.10
func (msg RoundStateMessage) String() string
func (*RoundStateMessage) Verify ¶ added in v0.9.10
func (msg *RoundStateMessage) Verify() error
type VoteSet ¶ added in v0.9.10
type VoteSet interface { CommitVoteSet() module.CommitVoteSet Add(idx int, vote interface{}) bool }
type WALManager ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.