Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component implements core.Consensus.
func New ¶ added in v0.5.0
func New(tcpNode host.Host, sender *p2p.Sender, peers []p2p.Peer, p2pKey *ecdsa.PrivateKey) (*Component, error)
New returns a new consensus QBFT component.
func (*Component) Propose ¶
Propose participants in a consensus instance proposing the provided data. It returns on error or nil when the context is cancelled.
func (*Component) Start ¶
Start registers the libp2p receive handler. This should only be called once.
func (*Component) Subscribe ¶
func (c *Component) Subscribe(fn func(ctx context.Context, duty core.Duty, set core.UnsignedDataSet) error)
Subscribe registers a callback for unsigned duty data proposals from leaders. Note this function is not thread safe, it should be called *before* Start and Propose.
Click to show internal directories.
Click to hide internal directories.