hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
command_service_transport_grpc.hpp
Go to the documentation of this file.
1 
6 #ifndef TORII_COMMAND_SERVICE_TRANSPORT_GRPC_HPP
7 #define TORII_COMMAND_SERVICE_TRANSPORT_GRPC_HPP
8 
10 
11 #include "endpoint.grpc.pb.h"
12 #include "endpoint.pb.h"
15 #include "logger/logger_fwd.hpp"
16 
17 namespace iroha::torii {
18  class StatusBus;
19 }
20 
21 namespace shared_model::interface {
22  class TxStatusFactory;
23  class TransactionBatchParser;
24  class TransactionBatchFactory;
25 } // namespace shared_model::interface
26 
27 namespace iroha::torii {
29  : public iroha::protocol::CommandService_v1::Service {
30  public:
31  using TransportFactoryType =
35 
36  struct ConsensusGateEvent {};
37 
51  std::shared_ptr<CommandService> command_service,
52  std::shared_ptr<iroha::torii::StatusBus> status_bus,
53  std::shared_ptr<shared_model::interface::TxStatusFactory>
54  status_factory,
55  std::shared_ptr<TransportFactoryType> transaction_factory,
56  std::shared_ptr<shared_model::interface::TransactionBatchParser>
57  batch_parser,
58  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
59  transaction_batch_factory,
60  int maximum_rounds_without_update,
61  logger::LoggerPtr log);
62 
70  grpc::Status Torii(grpc::ServerContext *context,
71  const iroha::protocol::Transaction *request,
72  google::protobuf::Empty *response) override;
73 
81  grpc::Status ListTorii(grpc::ServerContext *context,
82  const iroha::protocol::TxList *request,
83  google::protobuf::Empty *response) override;
84 
94  grpc::Status Status(grpc::ServerContext *context,
95  const iroha::protocol::TxStatusRequest *request,
96  iroha::protocol::ToriiResponse *response) override;
97 
107  grpc::Status StatusStream(grpc::ServerContext *context,
108  const iroha::protocol::TxStatusRequest *request,
109  grpc::ServerWriter<iroha::protocol::ToriiResponse>
110  *response_writer) override;
111 
112  private:
113  std::shared_ptr<CommandService> command_service_;
114  std::shared_ptr<iroha::torii::StatusBus> status_bus_;
115  std::shared_ptr<shared_model::interface::TxStatusFactory> status_factory_;
116  std::shared_ptr<TransportFactoryType> transaction_factory_;
117  std::shared_ptr<shared_model::interface::TransactionBatchParser>
118  batch_parser_;
119  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
120  batch_factory_;
121  logger::LoggerPtr log_;
122 
123  const int maximum_rounds_without_update_;
124  };
125 } // namespace iroha::torii
126 
127 #endif // TORII_COMMAND_SERVICE_TRANSPORT_GRPC_HPP
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: command_executor.hpp:14
Definition: application.hpp:79
Definition: command_service_transport_grpc.hpp:36
Status
Definition: status.hpp:12
Definition: transaction.hpp:23
Definition: command_service_transport_grpc.hpp:28