Documentation ¶
Index ¶
- Constants
- func LogMsg(msg interface{})
- func LogStage(stage string, isDone bool)
- type MsgBuffer
- type Node
- func (node *Node) Broadcast(msg interface{}, path string) map[string]error
- func (node *Node) GetCommit(commitMsg *consensus.VoteMsg) error
- func (node *Node) GetPrePrepare(prePrepareMsg *consensus.PrePrepareMsg) error
- func (node *Node) GetPrepare(prepareMsg *consensus.VoteMsg) error
- func (node *Node) GetReply(msg *consensus.ReplyMsg)
- func (node *Node) GetReq(reqMsg *consensus.RequestMsg) error
- func (node *Node) LogMsg(msg interface{})
- func (node *Node) LogStage(stage string, isDone bool)
- func (node *Node) Reply(msg *consensus.ReplyMsg) error
- type Server
- type View
Constants ¶
View Source
const ResolvingTimeDuration = time.Millisecond * 1000 // 1 second.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MsgBuffer ¶
type MsgBuffer struct { ReqMsgs []*consensus.RequestMsg PrePrepareMsgs []*consensus.PrePrepareMsg PrepareMsgs []*consensus.VoteMsg CommitMsgs []*consensus.VoteMsg }
type Node ¶
type Node struct { NodeID string NodeTable map[string]string // key=nodeID, value=url View *View CurrentState *consensus.State CommittedMsgs []*consensus.RequestMsg // kinda block. MsgBuffer *MsgBuffer MsgEntrance chan interface{} MsgDelivery chan interface{} Alarm chan bool // contains filtered or unexported fields }
func (*Node) GetPrePrepare ¶
func (node *Node) GetPrePrepare(prePrepareMsg *consensus.PrePrepareMsg) error
GetPrePrepare can be called when the node's CurrentState is nil. Consensus start procedure for normal participants.
Click to show internal directories.
Click to hide internal directories.