eventdriven

package
v0.0.0-...-ae125c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPacemaker

func NewPacemaker(e *EventDrivenHotStuffImpl) *pacemakerImpl

Types

type Event

type Event uint8
const (
	QCFinish Event = iota
	ReceiveProposal
	ReceiveNewView
)

type EventDrivenHotStuff

type EventDrivenHotStuff interface {
	Update(block *pb.Block)
	OnCommit(block *pb.Block)
	OnReceiveProposal(msg *pb.Prepare) (*tcrsa.SigShare, error)
	OnReceiveVote(partSig *tcrsa.SigShare)
	OnPropose()
}

type EventDrivenHotStuffImpl

type EventDrivenHotStuffImpl struct {
	consensus.HotStuffImpl
	// contains filtered or unexported fields
}

func NewEventDrivenHotStuff

func NewEventDrivenHotStuff(id int, handleMethod func(string) string) *EventDrivenHotStuffImpl

func (*EventDrivenHotStuffImpl) GetEvents

func (ehs *EventDrivenHotStuffImpl) GetEvents() chan Event

func (*EventDrivenHotStuffImpl) GetHeight

func (ehs *EventDrivenHotStuffImpl) GetHeight() uint64

func (*EventDrivenHotStuffImpl) GetHighQC

func (ehs *EventDrivenHotStuffImpl) GetHighQC() *pb.QuorumCert

func (*EventDrivenHotStuffImpl) GetLeaf

func (ehs *EventDrivenHotStuffImpl) GetLeaf() *pb.Block

func (*EventDrivenHotStuffImpl) GetVHeight

func (ehs *EventDrivenHotStuffImpl) GetVHeight() uint64

func (*EventDrivenHotStuffImpl) OnCommit

func (ehs *EventDrivenHotStuffImpl) OnCommit(block *pb.Block)

func (*EventDrivenHotStuffImpl) OnPropose

func (ehs *EventDrivenHotStuffImpl) OnPropose()

func (*EventDrivenHotStuffImpl) OnReceiveProposal

func (ehs *EventDrivenHotStuffImpl) OnReceiveProposal(msg *pb.Prepare) (*tcrsa.SigShare, error)

func (*EventDrivenHotStuffImpl) OnReceiveVote

func (ehs *EventDrivenHotStuffImpl) OnReceiveVote(partSig *tcrsa.SigShare)

func (*EventDrivenHotStuffImpl) SafeExit

func (ehs *EventDrivenHotStuffImpl) SafeExit()

func (*EventDrivenHotStuffImpl) SetLeaf

func (ehs *EventDrivenHotStuffImpl) SetLeaf(b *pb.Block)

func (*EventDrivenHotStuffImpl) Update

func (ehs *EventDrivenHotStuffImpl) Update(block *pb.Block)

Update update blocks before block

type Pacemaker

type Pacemaker interface {
	UpdateHighQC(qcHigh *pb.QuorumCert)
	OnBeat()
	OnNextSyncView()
	OnReceiverNewView(qc *pb.QuorumCert)
	Run(ctx context.Context)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL