Documentation
¶
Index ¶
- Variables
- func FixedProposer(delegates []net.Addr, _ []byte, _ uint64, _ uint64) (net.Addr, error)
- func GeneratePseudoDKG() (common.DKGHash, error)
- func NeverStartNewEpoch(_ net.Addr, _ uint64, _ state.Factory, _ delegate.Pool) (bool, error)
- func PseudoRotatedProposer(delegates []net.Addr, _ []byte, _ uint64, height uint64) (net.Addr, error)
- func PseudoStarNewEpoch(_ net.Addr, _ uint64, _ state.Factory, _ delegate.Pool) (bool, error)
- func PseudoStartRollingEpoch(self net.Addr, epochNum uint64, _ state.Factory, pool delegate.Pool) (bool, error)
- type DNet
- type RollDPoS
- func (n *RollDPoS) EventChan() *chan *fsm.Event
- func (n *RollDPoS) FSM() *fsm.Machine
- func (n *RollDPoS) Handle(m proto.Message) error
- func (n *RollDPoS) Metrics() (scheme.ConsensusMetrics, error)
- func (n *RollDPoS) SetDoneStream(done chan bool)
- func (n *RollDPoS) Start() error
- func (n *RollDPoS) Stop() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidViewChangeMsg is the error that ViewChangeMsg is invalid ErrInvalidViewChangeMsg = errors.New("ViewChangeMsg is invalid") )
Functions ¶
func FixedProposer ¶
FixedProposer will always choose the first in the delegate list as the proposer
func GeneratePseudoDKG ¶
GeneratePseudoDKG generates a pseudo DKG bytes
func NeverStartNewEpoch ¶
NeverStartNewEpoch will never allow to start a new epochStart after the first one
func PseudoRotatedProposer ¶
func PseudoRotatedProposer(delegates []net.Addr, _ []byte, _ uint64, height uint64) (net.Addr, error)
PseudoRotatedProposer will rotate among the delegates to choose the proposer
func PseudoStarNewEpoch ¶
PseudoStarNewEpoch will always allow to start a new epochStart after the first one
Types ¶
type DNet ¶
type DNet interface { Tell(node net.Addr, msg proto.Message) error Self() net.Addr Broadcast(msg proto.Message) error }
DNet is the delegate networks interface.
type RollDPoS ¶
type RollDPoS struct {
// contains filtered or unexported fields
}
RollDPoS is the RollDPoS consensus scheme
func NewRollDPoS ¶
func NewRollDPoS( cfg config.RollDPoS, prop scheme.CreateBlockCB, vote scheme.TellPeerCB, cons scheme.ConsensusDoneCB, pub scheme.BroadcastCB, pr scheme.GetProposerCB, epochStart scheme.StartNextEpochCB, dkg scheme.GenerateDKGCB, bc blockchain.Blockchain, myaddr net.Addr, dlg delegate.Pool, sf state.Factory, ) *RollDPoS
NewRollDPoS creates a RollDPoS struct
func (*RollDPoS) Metrics ¶
func (n *RollDPoS) Metrics() (scheme.ConsensusMetrics, error)
Metrics returns the roll dpos metrics
func (*RollDPoS) SetDoneStream ¶
SetDoneStream sets a boolean channel which indicates to the simulator that the consensus is done
Click to show internal directories.
Click to hide internal directories.