pacemaker

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FixedLeader

type FixedLeader struct {
	*hotstuff.HotStuff
	// contains filtered or unexported fields
}

FixedLeader uses a fixed leader.

func NewFixedLeader

func NewFixedLeader(leaderID config.ReplicaID) *FixedLeader

NewFixedLeader returns a new fixed leader pacemaker

func (*FixedLeader) GetLeader

func (p *FixedLeader) GetLeader(_ int) config.ReplicaID

func (*FixedLeader) Init

func (p *FixedLeader) Init(hs *hotstuff.HotStuff)

func (*FixedLeader) Run

func (p *FixedLeader) Run(ctx context.Context)

Run runs the pacemaker which will beat when the previous QC is completed

type RoundRobin

type RoundRobin struct {
	*hotstuff.HotStuff
	// contains filtered or unexported fields
}

RoundRobin change leader in a RR fashion. The amount of commands to be executed before it changes leader can be customized.

func NewRoundRobin

func NewRoundRobin(termLength int, schedule []config.ReplicaID, timeout time.Duration) *RoundRobin

NewRoundRobin returns a new round robin pacemaker

func (*RoundRobin) GetLeader

func (p *RoundRobin) GetLeader(view int) config.ReplicaID

GetLeader returns the fixed ID of the leader for the view height

func (*RoundRobin) Init

func (p *RoundRobin) Init(hs *hotstuff.HotStuff)

func (*RoundRobin) Run

func (p *RoundRobin) Run(ctx context.Context)

Run runs the pacemaker which will beat when the previous QC is completed

Jump to

Keyboard shortcuts

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