Documentation ¶
Index ¶
- func Hash(content []byte) string
- type MsgLogs
- type MsgType
- type PBFT
- type PrePrepareMsg
- type ReplyMsg
- type RequestMsg
- type Stage
- type State
- func (state *State) Commit(commitMsg *VoteMsg) (*ReplyMsg, *RequestMsg, error)
- func (state *State) PrePrepare(prePrepareMsg *PrePrepareMsg) (*VoteMsg, error)
- func (state *State) Prepare(prepareMsg *VoteMsg) (*VoteMsg, error)
- func (state *State) StartConsensus(request *RequestMsg) (*PrePrepareMsg, error)
- type VoteMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MsgLogs ¶
type MsgLogs struct { ReqMsg *RequestMsg PrepareMsgs map[string]*VoteMsg CommitMsgs map[string]*VoteMsg }
type PBFT ¶
type PBFT interface { StartConsensus(request *RequestMsg) (*PrePrepareMsg, error) PrePrepare(prePrepareMsg *PrePrepareMsg) (*VoteMsg, error) Prepare(prepareMsg *VoteMsg) (*VoteMsg, error) Commit(commitMsg *VoteMsg) (*ReplyMsg, *RequestMsg, error) }
type PrePrepareMsg ¶
type PrePrepareMsg struct { ViewID int64 `json:"viewID"` SequenceID int64 `json:"sequenceID"` Digest string `json:"digest"` RequestMsg *RequestMsg `json:"requestMsg"` }
type RequestMsg ¶
type Stage ¶
type Stage int
const ( Idle Stage = iota // Node is created successfully, but the consensus process is not started yet. PrePrepared // The ReqMsgs is processed successfully. The node is ready to head to the Prepare stage. Prepared // Same with `prepared` stage explained in the original paper. Committed // Same with `committed-local` stage explained in the original paper. )
type State ¶
func CreateState ¶
func (*State) Commit ¶
func (state *State) Commit(commitMsg *VoteMsg) (*ReplyMsg, *RequestMsg, error)
func (*State) PrePrepare ¶
func (state *State) PrePrepare(prePrepareMsg *PrePrepareMsg) (*VoteMsg, error)
func (*State) StartConsensus ¶
func (state *State) StartConsensus(request *RequestMsg) (*PrePrepareMsg, error)
Click to show internal directories.
Click to hide internal directories.