hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ordering::OnDemandConnectionManager Class Reference

#include "on_demand_connection_manager.hpp"

Inheritance diagram for iroha::ordering::OnDemandConnectionManager:
Inheritance graph
Collaboration diagram for iroha::ordering::OnDemandConnectionManager:
Collaboration graph

Classes

struct  CurrentPeers
 

Public Types

enum  PeerType {
  kCurrentRoundRejectConsumer = 0, kNextRoundRejectConsumer, kNextRoundCommitConsumer, kIssuer,
  kCount
}
 
template<typename T >
using PeerCollectionType = std::array< T, kCount >
 Collection with value types which represent peers. More...
 
- Public Types inherited from iroha::ordering::transport::OdOsNotification
using ProposalType = std::unique_ptr< shared_model::interface::Proposal >
 
using TransactionBatchType = std::shared_ptr< shared_model::interface::TransactionBatch >
 
using CollectionType = std::vector< TransactionBatchType >
 

Public Member Functions

 OnDemandConnectionManager (std::shared_ptr< transport::OdOsNotificationFactory > factory, rxcpp::observable< CurrentPeers > peers, logger::Logger log=logger::log("OnDemandConnectionManager"))
 
 OnDemandConnectionManager (std::shared_ptr< transport::OdOsNotificationFactory > factory, rxcpp::observable< CurrentPeers > peers, CurrentPeers initial_peers, logger::Logger log=logger::log("OnDemandConnectionManager"))
 
 ~OnDemandConnectionManager () override
 
void onBatches (consensus::Round round, CollectionType batches) override
 
boost::optional< ProposalTypeonRequestProposal (consensus::Round round) override
 
- Public Member Functions inherited from iroha::ordering::transport::OdOsNotification
virtual ~OdOsNotification ()=default
 

Detailed Description

Proxy class which redirects requests to appropriate peers

Member Typedef Documentation

template<typename T >
using iroha::ordering::OnDemandConnectionManager::PeerCollectionType = std::array<T, kCount>

Collection with value types which represent peers.

Member Enumeration Documentation

Responsibilities of individual peers from the peers array Transactions are sent to three ordering services: reject round for current block, reject round for next block, and commit for subsequent next round Proposal is requested from the current ordering service: issuer

Enumerator
kCurrentRoundRejectConsumer 
kNextRoundRejectConsumer 
kNextRoundCommitConsumer 
kIssuer 
kCount 

Constructor & Destructor Documentation

OnDemandConnectionManager::OnDemandConnectionManager ( std::shared_ptr< transport::OdOsNotificationFactory factory,
rxcpp::observable< CurrentPeers peers,
logger::Logger  log = logger::log("OnDemandConnectionManager") 
)
OnDemandConnectionManager::OnDemandConnectionManager ( std::shared_ptr< transport::OdOsNotificationFactory factory,
rxcpp::observable< CurrentPeers peers,
CurrentPeers  initial_peers,
logger::Logger  log = logger::log("OnDemandConnectionManager") 
)
OnDemandConnectionManager::~OnDemandConnectionManager ( )
override

Member Function Documentation

void OnDemandConnectionManager::onBatches ( consensus::Round  round,
CollectionType  batches 
)
overridevirtual

Callback on receiving transactions

Parameters
round- expected proposal round
batches- vector of passed transaction batches

Implements iroha::ordering::transport::OdOsNotification.

Here is the call graph for this function:

boost::optional< OnDemandConnectionManager::ProposalType > OnDemandConnectionManager::onRequestProposal ( consensus::Round  round)
overridevirtual

Callback on request about proposal

Parameters
round- number of collaboration round. Calculated as block_height + 1
Returns
proposal for requested round

Implements iroha::ordering::transport::OdOsNotification.


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