hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
command_generator.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_COMMAND_GENERATOR_HPP
7 #define IROHA_COMMAND_GENERATOR_HPP
8 
9 #include <memory>
10 #include "crypto/keypair.hpp"
11 #include "generator/generator.hpp"
12 
13 namespace iroha {
14  namespace model {
15 
16  struct Peer;
17  struct Command;
18  struct Account;
19 
20  namespace generators {
21 
23  public:
24  std::shared_ptr<Command> generateAddPeer(const Peer &peer);
25 
26  std::shared_ptr<Command> generateAddSignatory(
27  const std::string &account_id, const pubkey_t &key);
28 
29  std::shared_ptr<Command> generateRemoveSignatory(
30  const std::string &account_id, const pubkey_t &key);
31 
32  std::shared_ptr<Command> generateCreateAccount(
33  const std::string &account_name,
34  const std::string &domain_id,
35  const pubkey_t &key);
36 
37  std::shared_ptr<Command> generateCreateDomain(
38  const std::string &domain_id, const std::string &default_role);
39 
40  std::shared_ptr<Command> generateCreateAsset(
41  const std::string &asset_name,
42  const std::string &domain_name,
43  uint8_t precision);
44 
45  template <typename Type, typename... ParamTypes>
46  std::shared_ptr<Command> generateCommand(ParamTypes... args) {
47  return std::make_shared<Type>(args...);
48  }
49 
50  std::shared_ptr<Command> generateCreateAdminRole(std::string role_name);
51 
52  std::shared_ptr<Command> generateCreateUserRole(std::string role_name);
53 
54  std::shared_ptr<Command> generateCreateAssetCreatorRole(
55  std::string role_name);
56 
57  std::shared_ptr<Command> generateSetQuorum(
58  const std::string &account_id, uint32_t quorum);
59 
60  std::shared_ptr<Command> generateAddAssetQuantity(
61  const std::string &asset_id, const std::string &amount);
62 
63  std::shared_ptr<Command> generateSubtractAssetQuantity(
64  const std::string &asset_id, const std::string &amount);
73  std::shared_ptr<Command> generateTransferAsset(
74  const std::string &src_account_id,
75  const std::string &target_account_id,
76  const std::string &asset_id,
77  const std::string &amount);
78 
79  std::shared_ptr<Command> generateAppendRole(
80  const std::string &account_id, const std::string &role_name);
81  };
82  } // namespace generators
83  } // namespace model
84 } // namespace iroha
85 
86 #endif // IROHA_COMMAND_GENERATOR_HPP
Definition: command_generator.hpp:22
std::shared_ptr< Command > generateTransferAsset(const std::string &src_account_id, const std::string &target_account_id, const std::string &asset_id, const std::string &amount)
Definition: command_generator.cpp:106
std::shared_ptr< Command > generateCreateUserRole(std::string role_name)
Definition: command_generator.cpp:72
std::shared_ptr< Command > generateAddPeer(const Peer &peer)
Definition: command_generator.cpp:29
std::shared_ptr< Command > generateSubtractAssetQuantity(const std::string &asset_id, const std::string &amount)
Definition: command_generator.cpp:96
std::shared_ptr< Command > generateCommand(ParamTypes...args)
Definition: command_generator.hpp:46
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
Definition: block_query.hpp:16
Definition: peer.hpp:17
std::shared_ptr< Command > generateRemoveSignatory(const std::string &account_id, const pubkey_t &key)
Definition: command_generator.cpp:39
std::shared_ptr< Command > generateCreateAccount(const std::string &account_name, const std::string &domain_id, const pubkey_t &key)
Definition: command_generator.cpp:44
std::shared_ptr< Command > generateAddAssetQuantity(const std::string &asset_id, const std::string &amount)
Definition: command_generator.cpp:91
std::shared_ptr< Command > generateCreateAssetCreatorRole(std::string role_name)
Definition: command_generator.cpp:83
std::shared_ptr< Command > generateCreateAsset(const std::string &asset_name, const std::string &domain_name, uint8_t precision)
Definition: command_generator.cpp:56
std::shared_ptr< Command > generateAppendRole(const std::string &account_id, const std::string &role_name)
Definition: command_generator.cpp:115
std::shared_ptr< Command > generateAddSignatory(const std::string &account_id, const pubkey_t &key)
Definition: command_generator.cpp:34
std::shared_ptr< Command > generateCreateAdminRole(std::string role_name)
Definition: command_generator.cpp:63
std::shared_ptr< Command > generateSetQuorum(const std::string &account_id, uint32_t quorum)
Definition: command_generator.cpp:101
std::shared_ptr< Command > generateCreateDomain(const std::string &domain_id, const std::string &default_role)
Definition: command_generator.cpp:51