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 {
  kRejectRejectConsumer = 0, kRejectCommitConsumer, kCommitRejectConsumer, kCommitCommitConsumer,
  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 = 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::LoggerPtr log)
 
 OnDemandConnectionManager (std::shared_ptr< transport::OdOsNotificationFactory > factory, rxcpp::observable< CurrentPeers > peers, CurrentPeers initial_peers, logger::LoggerPtr log)
 
 ~OnDemandConnectionManager () override
 
void onBatches (CollectionType batches) override
 
boost::optional< std::shared_ptr< const ProposalType > > onRequestProposal (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
kRejectRejectConsumer 
kRejectCommitConsumer 
kCommitRejectConsumer 
kCommitCommitConsumer 
kIssuer 
kCount 

Constructor & Destructor Documentation

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

Member Function Documentation

void OnDemandConnectionManager::onBatches ( CollectionType  batches)
overridevirtual

Callback on receiving transactions

Parameters
batches- vector of passed transaction batches

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

boost::optional< std::shared_ptr< const 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: