factory

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 14 Imported by: 0

README

ConsensusFactory

ConsensusFactory is responsible for initializing the consensus processes with the proper parameters. It subscribes to the initialization topic and, upon reception of a message, will start all of the components related to consensus. It should also contain all the relevant information for the processes it intends to start up.

API

- `New(eventBus, rpcBus, timeOut, keys, d, k)` - creates a `ConsensusFactory` by accepting an `EventBus`, an `RPCBus`, and the `timerLength` being the duration of all the phases. It also initializes the channel for listening to the initial _block height_ necessary to begin the consensus.
- `StartConsensus()` - after receiving an initialization message with the Block Height, proceed to start the consensus components by invoking:
    - `reputation.Launch`
    - `generation.Launch`
    - `selection.Launch`
    - `reduction.Launch`
    - `agreement.Launch`

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusFactory

type ConsensusFactory struct {
	key.Keys
	// contains filtered or unexported fields
}

ConsensusFactory is responsible for initializing the consensus processes with the proper parameters. It subscribes to the initialization topic and, upon reception of a message, will start all of the components related to consensus. It should also contain all the relevant information for the processes it intends to start up.

func New

func New(eventBus *eventbus.EventBus, rpcBus *rpcbus.RPCBus, timerLength time.Duration, walletPubKey *pkey.PublicKey, keys key.Keys) *ConsensusFactory

New returns an initialized ConsensusFactory.

func (*ConsensusFactory) StartConsensus

func (c *ConsensusFactory) StartConsensus()

StartConsensus will wait for a message to come in, and then proceed to start the consensus components.

Jump to

Keyboard shortcuts

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