hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::consensus::yac::Yac Class Reference

#include "yac.hpp"

Inheritance diagram for iroha::consensus::yac::Yac:
Inheritance graph
Collaboration diagram for iroha::consensus::yac::Yac:
Collaboration graph

Public Member Functions

 Yac (YacVoteStorage vote_storage, std::shared_ptr< YacNetwork > network, std::shared_ptr< YacCryptoProvider > crypto, std::shared_ptr< Timer > timer, shared_model::interface::types::PeerList order, Round round, logger::LoggerPtr log)
 
void vote (YacHash hash, ClusterOrdering order, std::optional< ClusterOrdering > alternative_order=std::nullopt) override
 
std::optional< AnswerprocessRoundSwitch (consensus::Round const &round, shared_model::interface::types::PeerList const &peers) override
 
std::optional< AnsweronState (std::vector< VoteMessage > state) override
 
void stop () override
 Prevent any new outgoing network activity. Be passive. More...
 
- Public Member Functions inherited from iroha::consensus::yac::HashGate
virtual ~HashGate ()=default
 
- Public Member Functions inherited from iroha::consensus::yac::YacNetworkNotifications
virtual ~YacNetworkNotifications ()=default
 

Static Public Member Functions

static std::shared_ptr< Yaccreate (YacVoteStorage vote_storage, std::shared_ptr< YacNetwork > network, std::shared_ptr< YacCryptoProvider > crypto, std::shared_ptr< Timer > timer, shared_model::interface::types::PeerList order, Round round, logger::LoggerPtr log)
 

Constructor & Destructor Documentation

◆ Yac()

Yac::Yac ( YacVoteStorage  vote_storage,
std::shared_ptr< YacNetwork network,
std::shared_ptr< YacCryptoProvider crypto,
std::shared_ptr< Timer timer,
shared_model::interface::types::PeerList  order,
Round  round,
logger::LoggerPtr  log 
)

Member Function Documentation

◆ create()

std::shared_ptr< Yac > Yac::create ( YacVoteStorage  vote_storage,
std::shared_ptr< YacNetwork network,
std::shared_ptr< YacCryptoProvider crypto,
std::shared_ptr< Timer timer,
shared_model::interface::types::PeerList  order,
Round  round,
logger::LoggerPtr  log 
)
static

Method for creating Yac consensus object

Parameters
delayfor timer in milliseconds

◆ onState()

std::optional< iroha::consensus::yac::Answer > Yac::onState ( std::vector< VoteMessage state)
overridevirtual

Callback on receiving collection of votes

Parameters
state- provided message

Implements iroha::consensus::yac::YacNetworkNotifications.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processRoundSwitch()

std::optional< iroha::consensus::yac::Answer > Yac::processRoundSwitch ( consensus::Round const &  round,
shared_model::interface::types::PeerList const &  peers 
)
overridevirtual

Update current state with the new round and peer list, possibly pruning the old state. Process states from future if available, and return the result

Parameters
round- new round
peers- new peer list
Returns
answer if storage already contains required votes

Implements iroha::consensus::yac::HashGate.

Here is the call graph for this function:

◆ stop()

void Yac::stop ( )
overridevirtual

Prevent any new outgoing network activity. Be passive.

Implements iroha::consensus::yac::HashGate.

◆ vote()

void Yac::vote ( YacHash  hash,
ClusterOrdering  order,
std::optional< ClusterOrdering alternative_order = std::nullopt 
)
overridevirtual

Proposal new hash in network

Parameters
hash- hash for voting
order- peer ordering for round in hash
alternative_order- peer order

Implements iroha::consensus::yac::HashGate.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: