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  class OnDemandOrderingService;
20  namespace transport {
21 
25  class OnDemandOsServerGrpc : public proto::OnDemandOrdering::Service {
26  public:
27  using TransportFactoryType =
31 
33  std::shared_ptr<OnDemandOrderingService> ordering_service,
34  std::shared_ptr<TransportFactoryType> transaction_factory,
35  std::shared_ptr<shared_model::interface::TransactionBatchParser>
36  batch_parser,
37  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
38  transaction_batch_factory,
40  std::chrono::milliseconds delay);
41 
42  grpc::Status SendBatches(::grpc::ServerContext *context,
43  const proto::BatchesRequest *request,
44  ::google::protobuf::Empty *response) override;
45 
47  ::grpc::ServerContext *context,
48  const proto::ProposalRequest *request,
49  proto::ProposalResponse *response) override;
50 
51  private:
52  std::shared_ptr<OnDemandOrderingService> ordering_service_;
53 
54  std::shared_ptr<TransportFactoryType> transaction_factory_;
55  std::shared_ptr<shared_model::interface::TransactionBatchParser>
56  batch_parser_;
57  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
58  batch_factory_;
59 
60  logger::LoggerPtr log_;
61  std::chrono::milliseconds delay_;
62  };
63 
64  } // namespace transport
65  } // namespace ordering
66 } // namespace iroha
67 
68 #endif // IROHA_ON_DEMAND_OS_TRANSPORT_SERVER_GRPC_HPP
Definition: on_demand_os_server_grpc.hpp:25
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:64
Definition: block_query.hpp:15
grpc::Status SendBatches(::grpc::ServerContext *context, const proto::BatchesRequest *request, ::google::protobuf::Empty *response) override
Definition: on_demand_os_server_grpc.cpp:36
OnDemandOsServerGrpc(std::shared_ptr< OnDemandOrderingService > 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, std::chrono::milliseconds delay)
Definition: on_demand_os_server_grpc.cpp:20
Status
Definition: status.hpp:12
Definition: transaction.hpp:23