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 "torii/command_client.hpp"
12 #include "torii/query_client.hpp"
13 
14 namespace shared_model {
15  namespace interface {
16  class Transaction;
17  class Query;
18  } // namespace interface
19 } // namespace shared_model
20 
21 namespace iroha_cli {
22 
23  class CliClient {
24  public:
25  template <typename T>
26  struct Response {
27  grpc::Status status;
28  T answer;
29  };
30 
31  // TODO 13/09/17 luckychess: check if we need more status codes IR-494
32  enum TxStatus { OK };
33 
34  CliClient(std::string target_ip, int port);
42 
49  const shared_model::interface::Query &query);
50 
52  std::string tx_hash);
53 
54  private:
55  torii::CommandSyncClient command_client_;
56  torii_utils::QuerySyncClient query_client_;
57  };
58 } // namespace iroha_cli
59 
60 #endif // IROHACLI_CLIENT_CPP_HPP
Definition: client.hpp:26
Definition: client.cpp:16
Definition: query_client.hpp:21
Definition: query.hpp:34
grpc::Status status
Definition: client.hpp:27
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
T answer
Definition: client.hpp:28
TxStatus
Definition: client.hpp:32
Definition: command_client.hpp:21
Definition: client.hpp:23
Definition: command_executor.hpp:12
Definition: transaction.hpp:22