hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
on_demand_os_server_grpc.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_ON_DEMAND_OS_TRANSPORT_SERVER_GRPC_HPP
7 #define IROHA_ON_DEMAND_OS_TRANSPORT_SERVER_GRPC_HPP
8 
10 
14 #include "logger/logger_fwd.hpp"
15 #include "ordering.grpc.pb.h"
16 
17 namespace iroha {
18  namespace ordering {
19  namespace transport {
20 
24  class OnDemandOsServerGrpc : public proto::OnDemandOrdering::Service {
25  public:
26  using TransportFactoryType =
30 
32  std::shared_ptr<OdOsNotification> ordering_service,
33  std::shared_ptr<TransportFactoryType> transaction_factory,
34  std::shared_ptr<shared_model::interface::TransactionBatchParser>
35  batch_parser,
36  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
37  transaction_batch_factory,
38  logger::LoggerPtr log);
39 
40  grpc::Status SendBatches(::grpc::ServerContext *context,
41  const proto::BatchesRequest *request,
42  ::google::protobuf::Empty *response) override;
43 
44  grpc::Status RequestProposal(
45  ::grpc::ServerContext *context,
46  const proto::ProposalRequest *request,
47  proto::ProposalResponse *response) override;
48 
49  private:
50  std::shared_ptr<OdOsNotification> ordering_service_;
51 
52  std::shared_ptr<TransportFactoryType> transaction_factory_;
53  std::shared_ptr<shared_model::interface::TransactionBatchParser>
54  batch_parser_;
55  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
56  batch_factory_;
57 
58  logger::LoggerPtr log_;
59  };
60 
61  } // namespace transport
62  } // namespace ordering
63 } // namespace iroha
64 
65 #endif // IROHA_ON_DEMAND_OS_TRANSPORT_SERVER_GRPC_HPP
Definition: on_demand_os_server_grpc.hpp:24
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
grpc::Status RequestProposal(::grpc::ServerContext *context, const proto::ProposalRequest *request, proto::ProposalResponse *response) override
Definition: on_demand_os_server_grpc.cpp:63
Definition: block_query.hpp:14
grpc::Status SendBatches(::grpc::ServerContext *context, const proto::BatchesRequest *request, ::google::protobuf::Empty *response) override
Definition: on_demand_os_server_grpc.cpp:36
Definition: transaction.hpp:23
OnDemandOsServerGrpc(std::shared_ptr< OdOsNotification > ordering_service, std::shared_ptr< TransportFactoryType > transaction_factory, std::shared_ptr< shared_model::interface::TransactionBatchParser > batch_parser, std::shared_ptr< shared_model::interface::TransactionBatchFactory > transaction_batch_factory, logger::LoggerPtr log)
Definition: on_demand_os_server_grpc.cpp:22