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

#include "on_demand_os_client_grpc.hpp"

Inheritance diagram for iroha::ordering::transport::OnDemandOsClientGrpc:
Inheritance graph
Collaboration diagram for iroha::ordering::transport::OnDemandOsClientGrpc:
Collaboration graph

Public Types

using TransportFactoryType = shared_model::interface::AbstractTransportFactory< shared_model::interface::Proposal, iroha::protocol::Proposal >
 
using TimepointType = std::chrono::system_clock::time_point
 
using TimeoutType = std::chrono::milliseconds
 
- 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

 OnDemandOsClientGrpc (std::unique_ptr< proto::OnDemandOrdering::StubInterface > stub, std::shared_ptr< network::AsyncGrpcClient< google::protobuf::Empty >> async_call, std::shared_ptr< TransportFactoryType > proposal_factory, std::function< TimepointType()> time_provider, std::chrono::milliseconds proposal_request_timeout, logger::Logger log=logger::log("OnDemandOsClientGrpc"))
 
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

gRPC client for on demand ordering service

Member Typedef Documentation

using iroha::ordering::transport::OnDemandOsClientGrpc::TimepointType = std::chrono::system_clock::time_point

Constructor & Destructor Documentation

OnDemandOsClientGrpc::OnDemandOsClientGrpc ( std::unique_ptr< proto::OnDemandOrdering::StubInterface >  stub,
std::shared_ptr< network::AsyncGrpcClient< google::protobuf::Empty >>  async_call,
std::shared_ptr< TransportFactoryType proposal_factory,
std::function< TimepointType()>  time_provider,
std::chrono::milliseconds  proposal_request_timeout,
logger::Logger  log = logger::log("OnDemandOsClientGrpc") 
)

Constructor is left public because testing required passing a mock stub interface

Member Function Documentation

void OnDemandOsClientGrpc::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.

boost::optional< OdOsNotification::ProposalType > OnDemandOsClientGrpc::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: