hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
interactive_cli.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CLI_INTERACTIVE_CLI_HPP
7 #define IROHA_CLI_INTERACTIVE_CLI_HPP
8 
13 
14 namespace iroha_cli {
15  namespace interactive {
16 
18  public:
32  const std::string &account_name,
33  const std::string &default_peer_ip,
34  int default_port,
35  uint64_t qry_counter,
36  const std::shared_ptr<iroha::model::ModelCryptoProvider> &provider,
37  logger::LoggerManagerTreePtr response_handler_log_manager,
38  logger::LoggerPtr pb_qry_factory_log,
39  logger::LoggerPtr json_qry_factory_log,
40  logger::LoggerManagerTreePtr log_manager);
44  void run();
45 
46  private:
50  void assign_main_handlers();
55  void parseMain(std::string line);
56 
60  void startQuery();
61 
65  void startTx();
66 
70  void startTxStatusRequest();
71 
72  const std::string TX_CODE = "tx";
73  const std::string QRY_CODE = "qry";
74  const std::string ST_CODE = "st";
75 
79  std::string creator_;
80 
81  // -- Query, tx cli --
83  InteractiveQueryCli query_cli_;
84  InteractiveStatusCli statusCli_;
85 
89  MenuPoints menu_points_;
90 
91  using MainHandler = void (InteractiveCli::*)();
92  std::unordered_map<std::string, MainHandler> main_handler_map_;
93  };
94 
95  } // namespace interactive
96 } // namespace iroha_cli
97 
98 #endif // IROHA_CLI_INTERACTIVE_CLI_HPP
Definition: client.cpp:16
void run()
Definition: interactive_cli.cpp:92
Definition: interactive_query_cli.hpp:26
Definition: interactive_transaction_cli.hpp:25
std::vector< std::string > MenuPoints
Definition: interactive_common_cli.hpp:60
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
InteractiveCli(const std::string &account_name, const std::string &default_peer_ip, int default_port, uint64_t qry_counter, const std::shared_ptr< iroha::model::ModelCryptoProvider > &provider, logger::LoggerManagerTreePtr response_handler_log_manager, logger::LoggerPtr pb_qry_factory_log, logger::LoggerPtr json_qry_factory_log, logger::LoggerManagerTreePtr log_manager)
Definition: interactive_cli.cpp:34
Definition: interactive_cli.hpp:17
std::shared_ptr< LoggerManagerTree > LoggerManagerTreePtr
Definition: logger_manager_fwd.hpp:14
Definition: interactive_status_cli.hpp:22