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 {
18  namespace torii {
19  class StatusBus;
20  }
21 } // namespace iroha
22 
23 namespace shared_model {
24  namespace interface {
25  class TxStatusFactory;
26  class TransactionBatchParser;
27  class TransactionBatchFactory;
28  } // namespace interface
29 } // namespace shared_model
30 
31 namespace iroha {
32  namespace torii {
34  : public iroha::protocol::CommandService_v1::Service {
35  public:
36  using TransportFactoryType =
40 
41  struct ConsensusGateEvent {};
42 
57  std::shared_ptr<CommandService> command_service,
58  std::shared_ptr<iroha::torii::StatusBus> status_bus,
59  std::shared_ptr<shared_model::interface::TxStatusFactory>
60  status_factory,
61  std::shared_ptr<TransportFactoryType> transaction_factory,
62  std::shared_ptr<shared_model::interface::TransactionBatchParser>
63  batch_parser,
64  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
65  transaction_batch_factory,
66  rxcpp::observable<ConsensusGateEvent> consensus_gate_objects,
67  int maximum_rounds_without_update,
68  logger::LoggerPtr log);
69 
77  grpc::Status Torii(grpc::ServerContext *context,
78  const iroha::protocol::Transaction *request,
79  google::protobuf::Empty *response) override;
80 
88  grpc::Status ListTorii(grpc::ServerContext *context,
89  const iroha::protocol::TxList *request,
90  google::protobuf::Empty *response) override;
91 
101  grpc::Status Status(grpc::ServerContext *context,
102  const iroha::protocol::TxStatusRequest *request,
103  iroha::protocol::ToriiResponse *response) override;
104 
114  grpc::Status StatusStream(
115  grpc::ServerContext *context,
116  const iroha::protocol::TxStatusRequest *request,
117  grpc::ServerWriter<iroha::protocol::ToriiResponse> *response_writer)
118  override;
119 
120  private:
125  deserializeTransactions(const iroha::protocol::TxList *request);
126 
127  std::shared_ptr<CommandService> command_service_;
128  std::shared_ptr<iroha::torii::StatusBus> status_bus_;
129  std::shared_ptr<shared_model::interface::TxStatusFactory> status_factory_;
130  std::shared_ptr<TransportFactoryType> transaction_factory_;
131  std::shared_ptr<shared_model::interface::TransactionBatchParser>
132  batch_parser_;
133  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
134  batch_factory_;
135  logger::LoggerPtr log_;
136 
137  rxcpp::observable<ConsensusGateEvent> consensus_gate_objects_;
138  const int maximum_rounds_without_update_;
139  };
140  } // namespace torii
141 } // namespace iroha
142 
143 #endif // TORII_COMMAND_SERVICE_TRANSPORT_GRPC_HPP
Definition: command_client.hpp:16
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: block_query.hpp:14
Definition: command_service_transport_grpc.hpp:41
Definition: command_executor.hpp:12
Definition: transaction.hpp:23
Definition: command_service_transport_grpc.hpp:33
std::vector< std::shared_ptr< Transaction >> SharedTxsCollectionType
Definition: transaction_sequence_common.hpp:27