hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
client.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHACLI_CLIENT_HPP
7 #define IROHACLI_CLIENT_HPP
8 
9 #include <string>
10 
11 #include "logger/logger_fwd.hpp"
12 #include "torii/command_client.hpp"
13 #include "torii/query_client.hpp"
14 
15 namespace shared_model {
16  namespace interface {
17  class Transaction;
18  class Query;
19  } // namespace interface
20 } // namespace shared_model
21 
22 namespace iroha_cli {
23 
24  class CliClient {
25  public:
26  template <typename T>
27  struct Response {
28  grpc::Status status;
29  T answer;
30  };
31 
32  // TODO 13/09/17 luckychess: check if we need more status codes IR-494
33  enum TxStatus { OK };
34 
35  CliClient(std::string target_ip,
36  int port,
37  logger::LoggerPtr pb_qry_factory_log);
45 
52  const shared_model::interface::Query &query);
53 
55  std::string tx_hash);
56 
57  private:
58  torii::CommandSyncClient command_client_;
59  torii_utils::QuerySyncClient query_client_;
60 
61  logger::LoggerPtr pb_qry_factory_log_;
62  };
63 } // namespace iroha_cli
64 
65 #endif // IROHACLI_CLIENT_CPP_HPP
Definition: client.hpp:27
Definition: client.cpp:16
Definition: query_client.hpp:21
Definition: query.hpp:34
grpc::Status status
Definition: client.hpp:28
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
T answer
Definition: client.hpp:29
TxStatus
Definition: client.hpp:33
Definition: command_client.hpp:21
Definition: client.hpp:24
Definition: command_executor.hpp:12
Definition: transaction.hpp:22