hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
command_service_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef TORII_COMMAND_SERVICE_IMPL_HPP
7 #define TORII_COMMAND_SERVICE_IMPL_HPP
8 
10 
11 #include "ametsuchi/storage.hpp"
12 #include "cache/cache.hpp"
13 #include "cryptography/hash.hpp"
15 #include "logger/logger.hpp"
17 #include "torii/status_bus.hpp"
18 
19 namespace iroha {
20  namespace torii {
25  public:
34  std::shared_ptr<iroha::torii::TransactionProcessor> tx_processor,
35  std::shared_ptr<iroha::ametsuchi::Storage> storage,
36  std::shared_ptr<iroha::torii::StatusBus> status_bus,
37  std::shared_ptr<shared_model::interface::TxStatusFactory>
38  status_factory,
39  logger::Logger log = logger::log("CommandServiceImpl"));
40 
45  CommandServiceImpl(const CommandServiceImpl &) = delete;
47 
49  std::shared_ptr<shared_model::interface::TransactionBatch> batch)
50  override;
51 
52  std::shared_ptr<shared_model::interface::TransactionResponse> getStatus(
53  const shared_model::crypto::Hash &request) override;
54  rxcpp::observable<
55  std::shared_ptr<shared_model::interface::TransactionResponse>>
57 
58  private:
65  inline void handleEvents(rxcpp::composite_subscription &subscription,
66  rxcpp::schedulers::run_loop &run_loop);
67 
73  void pushStatus(
74  const std::string &who,
75  std::shared_ptr<shared_model::interface::TransactionResponse>
76  response);
77 
83  void processBatch(
84  std::shared_ptr<shared_model::interface::TransactionBatch> batch);
85 
86  private:
89  std::shared_ptr<shared_model::interface::TransactionResponse>,
91 
92  std::shared_ptr<iroha::torii::TransactionProcessor> tx_processor_;
93  std::shared_ptr<iroha::ametsuchi::Storage> storage_;
94  std::shared_ptr<iroha::torii::StatusBus> status_bus_;
95  std::shared_ptr<CacheType> cache_;
96  std::shared_ptr<shared_model::interface::TxStatusFactory> status_factory_;
97 
98  logger::Logger log_;
99  };
100 
101  } // namespace torii
102 } // namespace iroha
103 
104 #endif // TORII_COMMAND_SERVICE_IMPL_HPP
void handleTransactionBatch(std::shared_ptr< shared_model::interface::TransactionBatch > batch) override
Definition: command_service_impl.cpp:48
Definition: hash.hpp:18
Definition: command_client.hpp:16
CommandServiceImpl(std::shared_ptr< iroha::torii::TransactionProcessor > tx_processor, std::shared_ptr< iroha::ametsuchi::Storage > storage, std::shared_ptr< iroha::torii::StatusBus > status_bus, std::shared_ptr< shared_model::interface::TxStatusFactory > status_factory, logger::Logger log=logger::log("CommandServiceImpl"))
Definition: command_service_impl.cpp:19
CommandServiceImpl & operator=(const CommandServiceImpl &)=delete
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
std::shared_ptr< spdlog::logger > Logger
Definition: logger.hpp:26
Definition: block_query.hpp:16
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
rxcpp::observable< std::shared_ptr< shared_model::interface::TransactionResponse > > getStatusStream(const shared_model::crypto::Hash &hash) override
Definition: command_service_impl.cpp:106
Logger log(const std::string &tag)
Definition: logger.cpp:48
Definition: command_service.hpp:26
Definition: command_service_impl.hpp:24
Definition: cache.hpp:25
Definition: hash.hpp:23
std::shared_ptr< shared_model::interface::TransactionResponse > getStatus(const shared_model::crypto::Hash &request) override
Definition: command_service_impl.cpp:54