Documentation ¶
Index ¶
- func GenerateGenesisBlock() *pb.Block
- type CurProposal
- type HotStuff
- type HotStuffImpl
- func (h *HotStuffImpl) Broadcast(msg *pb.Msg) error
- func (h *HotStuffImpl) CreateLeaf(parentHash []byte, cmds []string, justify *pb.QuorumCert) *pb.Block
- func (h *HotStuffImpl) GetLeader() uint32
- func (h *HotStuffImpl) GetMsgEntrance() chan<- *pb.Msg
- func (h *HotStuffImpl) GetNetworkInfo() map[uint32]string
- func (h *HotStuffImpl) GetSelfInfo() *config.ReplicaInfo
- func (h *HotStuffImpl) MatchingMsg(msg *pb.Msg, msgType pb.MsgType) bool
- func (h *HotStuffImpl) MatchingQC(qc *pb.QuorumCert, msgType pb.MsgType) bool
- func (h *HotStuffImpl) Msg(msgType pb.MsgType, node *pb.Block, qc *pb.QuorumCert) *pb.Msg
- func (h *HotStuffImpl) ProcessProposal(cmds []string)
- func (h *HotStuffImpl) QC(msgType pb.MsgType, sig tcrsa.Signature, blockHash []byte) *pb.QuorumCert
- func (h *HotStuffImpl) SafeExit()
- func (h *HotStuffImpl) SafeNode(node *pb.Block, qc *pb.QuorumCert) bool
- func (h *HotStuffImpl) Unicast(address string, msg *pb.Msg) error
- func (h *HotStuffImpl) VoteMsg(msgType pb.MsgType, node *pb.Block, qc *pb.QuorumCert, justify []byte) *pb.Msg
- type HotStuffService
- func (basic *HotStuffService) GetImpl() HotStuff
- func (basic *HotStuffService) SendMsg(ctx context.Context, in *pb.Msg) (*pb.Empty, error)
- func (basic *HotStuffService) SendReply(ctx context.Context, in *pb.Msg) (*pb.Empty, error)
- func (basic *HotStuffService) SendRequest(ctx context.Context, in *pb.Msg) (*pb.Empty, error)
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateGenesisBlock ¶
GenerateGenesisBlock returns genesis block
Types ¶
type CurProposal ¶
type CurProposal struct { Node *pb.Block DocumentHash []byte PrepareVote []*tcrsa.SigShare PreCommitVote []*tcrsa.SigShare CommitVote []*tcrsa.SigShare HighQC []*pb.QuorumCert }
func NewCurProposal ¶
func NewCurProposal() *CurProposal
type HotStuff ¶
type HotStuff interface { Msg(msgType pb.MsgType, node *pb.Block, qc *pb.QuorumCert) *pb.Msg VoteMsg(msgType pb.MsgType, node *pb.Block, qc *pb.QuorumCert, justify []byte) *pb.Msg CreateLeaf(parentHash []byte, cmds []string, justify *pb.QuorumCert) *pb.Block QC(msgType pb.MsgType, sig tcrsa.Signature, blockHash []byte) *pb.QuorumCert MatchingMsg(msg *pb.Msg, msgType pb.MsgType) bool MatchingQC(qc *pb.QuorumCert, msgType pb.MsgType) bool SafeNode(node *pb.Block, qc *pb.QuorumCert) bool GetMsgEntrance() chan<- *pb.Msg GetSelfInfo() *config.ReplicaInfo SafeExit() }
common hotstuff func defined in the paper
type HotStuffImpl ¶
type HotStuffImpl struct { ID uint32 BlockStorage go_hotstuff.BlockStorage View *View Config config.HotStuffConfig TimeChan *go_hotstuff.Timer BatchTimeChan *go_hotstuff.Timer CurExec *CurProposal CmdSet go_hotstuff.CmdSet HighQC *pb.QuorumCert PrepareQC *pb.QuorumCert // highQC PreCommitQC *pb.QuorumCert // lockQC CommitQC *pb.QuorumCert MsgEntrance chan *pb.Msg // receive msg ProcessMethod func(args string) string }
func (*HotStuffImpl) CreateLeaf ¶
func (h *HotStuffImpl) CreateLeaf(parentHash []byte, cmds []string, justify *pb.QuorumCert) *pb.Block
func (*HotStuffImpl) GetLeader ¶
func (h *HotStuffImpl) GetLeader() uint32
GetLeader get the leader replica in view
func (*HotStuffImpl) GetMsgEntrance ¶
func (h *HotStuffImpl) GetMsgEntrance() chan<- *pb.Msg
func (*HotStuffImpl) GetNetworkInfo ¶
func (h *HotStuffImpl) GetNetworkInfo() map[uint32]string
func (*HotStuffImpl) GetSelfInfo ¶
func (h *HotStuffImpl) GetSelfInfo() *config.ReplicaInfo
func (*HotStuffImpl) MatchingMsg ¶
func (*HotStuffImpl) MatchingQC ¶
func (h *HotStuffImpl) MatchingQC(qc *pb.QuorumCert, msgType pb.MsgType) bool
func (*HotStuffImpl) Msg ¶
func (h *HotStuffImpl) Msg(msgType pb.MsgType, node *pb.Block, qc *pb.QuorumCert) *pb.Msg
func (*HotStuffImpl) ProcessProposal ¶
func (h *HotStuffImpl) ProcessProposal(cmds []string)
func (*HotStuffImpl) QC ¶
func (h *HotStuffImpl) QC(msgType pb.MsgType, sig tcrsa.Signature, blockHash []byte) *pb.QuorumCert
func (*HotStuffImpl) SafeExit ¶
func (h *HotStuffImpl) SafeExit()
func (*HotStuffImpl) SafeNode ¶
func (h *HotStuffImpl) SafeNode(node *pb.Block, qc *pb.QuorumCert) bool
type HotStuffService ¶
type HotStuffService struct {
// contains filtered or unexported fields
}
func NewHotStuffService ¶
func NewHotStuffService(impl HotStuff) *HotStuffService
func (*HotStuffService) GetImpl ¶
func (basic *HotStuffService) GetImpl() HotStuff
func (*HotStuffService) SendRequest ¶
Click to show internal directories.
Click to hide internal directories.