hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
command_client.hpp
Go to the documentation of this file.
1 
6 #ifndef TORII_COMMAND_CLIENT_HPP
7 #define TORII_COMMAND_CLIENT_HPP
8 
9 #include <endpoint.grpc.pb.h>
10 #include <grpc++/grpc++.h>
11 #include <memory>
12 #include <thread>
13 
14 #include "logger/logger.hpp"
15 
16 namespace torii {
17 
22  public:
24  std::unique_ptr<iroha::protocol::CommandService_v1::StubInterface> stub,
25  logger::Logger log = logger::log("CommandSyncClient"));
26 
32  grpc::Status Torii(const iroha::protocol::Transaction &tx) const;
33 
39  grpc::Status ListTorii(const iroha::protocol::TxList &tx_list) const;
40 
46  grpc::Status Status(const iroha::protocol::TxStatusRequest &tx,
47  iroha::protocol::ToriiResponse &response) const;
48 
55  void StatusStream(
56  const iroha::protocol::TxStatusRequest &tx,
57  std::vector<iroha::protocol::ToriiResponse> &response) const;
58 
59  private:
60  std::unique_ptr<iroha::protocol::CommandService_v1::StubInterface> stub_;
61  logger::Logger log_;
62  };
63 
64 } // namespace torii
65 
66 #endif // TORII_COMMAND_CLIENT_HPP
void StatusStream(const iroha::protocol::TxStatusRequest &tx, std::vector< iroha::protocol::ToriiResponse > &response) const
Definition: command_client.cpp:44
CommandSyncClient(std::unique_ptr< iroha::protocol::CommandService_v1::StubInterface > stub, logger::Logger log=logger::log("CommandSyncClient"))
Definition: command_client.cpp:19
Definition: command_client.hpp:16
std::shared_ptr< spdlog::logger > Logger
Definition: logger.hpp:26
grpc::Status Status(const iroha::protocol::TxStatusRequest &tx, iroha::protocol::ToriiResponse &response) const
Definition: command_client.cpp:37
Logger log(const std::string &tag)
Definition: logger.cpp:48
grpc::Status ListTorii(const iroha::protocol::TxList &tx_list) const
Definition: command_client.cpp:30
Definition: command_client.hpp:21
grpc::Status Torii(const iroha::protocol::Transaction &tx) const
Definition: command_client.cpp:24