Documentation ¶
Index ¶
- type Consensus
- type IotxConsensus
- func (c *IotxConsensus) HandleBlockPropose(m proto.Message, done chan bool) error
- func (c *IotxConsensus) HandleViewChange(m proto.Message, done chan bool) error
- func (c *IotxConsensus) Metrics() (scheme.ConsensusMetrics, error)
- func (c *IotxConsensus) Scheme() scheme.Scheme
- func (c *IotxConsensus) Start(ctx context.Context) error
- func (c *IotxConsensus) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consensus ¶
type Consensus interface { lifecycle.StartStopper HandleViewChange(proto.Message, chan bool) error HandleBlockPropose(proto.Message, chan bool) error Metrics() (scheme.ConsensusMetrics, error) }
Consensus is the interface for handling IotxConsensus view change.
func NewConsensus ¶
func NewConsensus( cfg *config.Config, bc blockchain.Blockchain, ap actpool.ActPool, p2p network.Overlay, ) Consensus
NewConsensus creates a IotxConsensus struct.
type IotxConsensus ¶
type IotxConsensus struct {
// contains filtered or unexported fields
}
IotxConsensus implements Consensus
func (*IotxConsensus) HandleBlockPropose ¶
func (c *IotxConsensus) HandleBlockPropose(m proto.Message, done chan bool) error
HandleBlockPropose handles a proposed block
func (*IotxConsensus) HandleViewChange ¶
func (c *IotxConsensus) HandleViewChange(m proto.Message, done chan bool) error
HandleViewChange dispatches the call to different schemes
func (*IotxConsensus) Metrics ¶
func (c *IotxConsensus) Metrics() (scheme.ConsensusMetrics, error)
Metrics returns consensus metrics
func (*IotxConsensus) Scheme ¶
func (c *IotxConsensus) Scheme() scheme.Scheme
Scheme returns the scheme instance
Click to show internal directories.
Click to hide internal directories.