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.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::Logger log = logger::log("OnDemandOsServerGrpc"));
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:
54  deserializeTransactions(const proto::BatchesRequest *request);
55 
56  std::shared_ptr<OdOsNotification> ordering_service_;
57 
58  std::shared_ptr<TransportFactoryType> transaction_factory_;
59  std::shared_ptr<shared_model::interface::TransactionBatchParser>
60  batch_parser_;
61  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
62  batch_factory_;
63 
64  logger::Logger log_;
65  };
66 
67  } // namespace transport
68  } // namespace ordering
69 } // namespace iroha
70 
71 #endif // IROHA_ON_DEMAND_OS_TRANSPORT_SERVER_GRPC_HPP
grpc::Status SendBatches(::grpc::ServerContext *context, const proto::BatchesRequest *request,::google::protobuf::Empty *response) override
Definition: on_demand_os_server_grpc.cpp:63
Definition: on_demand_os_server_grpc.hpp:24
std::shared_ptr< spdlog::logger > Logger
Definition: logger.hpp:26
grpc::Status RequestProposal(::grpc::ServerContext *context, const proto::ProposalRequest *request, proto::ProposalResponse *response) override
Definition: on_demand_os_server_grpc.cpp:93
Definition: block_query.hpp:16
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::Logger log=logger::log("OnDemandOsServerGrpc"))
Definition: on_demand_os_server_grpc.cpp:19
Logger log(const std::string &tag)
Definition: logger.cpp:48
Definition: transaction.hpp:22
std::vector< std::shared_ptr< Transaction >> SharedTxsCollectionType
Definition: transaction_sequence_common.hpp:27