hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha_conf_loader.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CONF_LOADER_HPP
7 #define IROHA_CONF_LOADER_HPP
8 
9 #include <string>
10 #include <unordered_map>
11 
12 #include "common/result_fwd.hpp"
16 #include "torii/tls_params.hpp"
17 
18 struct IrohadConfig {
19  struct DbConfig {
20  std::string host;
21  uint16_t port;
22  std::string user;
23  std::string password;
24  std::string working_dbname;
25  std::string maintenance_dbname;
26  };
27 
28  struct InterPeerTls {
29  struct RootCert {
30  std::string path;
31  };
32  struct FromWsv {};
33  struct None {};
34  using PeerCertProvider = boost::variant<RootCert, FromWsv, None>;
35 
36  boost::optional<std::string> my_tls_creds_path;
38  };
39 
40  // TODO: block_store_path is now optional, change docs IR-576
41  // luckychess 29.06.2019
42  boost::optional<std::string> block_store_path;
43  uint16_t torii_port;
44  boost::optional<iroha::torii::TlsParams> torii_tls_params;
45  boost::optional<InterPeerTls> inter_peer_tls;
46  uint16_t internal_port;
47  boost::optional<std::string>
48  pg_opt; // TODO 2019.06.26 mboldyrev IR-556 remove
49  boost::optional<DbConfig>
50  database_config; // TODO 2019.06.26 mboldyrev IR-556 make required
52  uint32_t proposal_delay;
53  uint32_t vote_delay;
55  boost::optional<uint32_t> mst_expiration_time;
56  boost::optional<uint32_t> max_round_delay_ms;
57  boost::optional<uint32_t> stale_stream_max_rounds;
58  boost::optional<logger::LoggerManagerTreePtr> logger_manager;
59  boost::optional<shared_model::interface::types::PeerList> initial_peers;
60 };
61 
68  const std::string &conf_path,
69  std::shared_ptr<shared_model::interface::CommonObjectsFactory>
70  common_objects_factory);
71 
72 #endif // IROHA_CONF_LOADER_HPP
std::string maintenance_dbname
Definition: iroha_conf_loader.hpp:25
uint16_t port
Definition: iroha_conf_loader.hpp:21
boost::optional< uint32_t > max_round_delay_ms
Definition: iroha_conf_loader.hpp:56
boost::variant< RootCert, FromWsv, None > PeerCertProvider
Definition: iroha_conf_loader.hpp:34
PeerCertProvider peer_certificates
Definition: iroha_conf_loader.hpp:37
Definition: result_fwd.hpp:27
boost::optional< iroha::torii::TlsParams > torii_tls_params
Definition: iroha_conf_loader.hpp:44
boost::optional< uint32_t > stale_stream_max_rounds
Definition: iroha_conf_loader.hpp:57
boost::optional< InterPeerTls > inter_peer_tls
Definition: iroha_conf_loader.hpp:45
std::string host
Definition: iroha_conf_loader.hpp:20
boost::optional< std::string > my_tls_creds_path
Definition: iroha_conf_loader.hpp:36
Definition: iroha_conf_loader.hpp:32
uint32_t proposal_delay
Definition: iroha_conf_loader.hpp:52
Definition: iroha_conf_loader.hpp:29
Definition: iroha_conf_loader.hpp:18
uint16_t internal_port
Definition: iroha_conf_loader.hpp:46
Definition: iroha_conf_loader.hpp:33
uint32_t max_proposal_size
Definition: iroha_conf_loader.hpp:51
boost::optional< std::string > pg_opt
Definition: iroha_conf_loader.hpp:48
boost::optional< shared_model::interface::types::PeerList > initial_peers
Definition: iroha_conf_loader.hpp:59
std::string password
Definition: iroha_conf_loader.hpp:23
iroha::expected::Result< IrohadConfig, std::string > parse_iroha_config(const std::string &conf_path, std::shared_ptr< shared_model::interface::CommonObjectsFactory > common_objects_factory)
Definition: iroha_conf_loader.cpp:480
boost::optional< uint32_t > mst_expiration_time
Definition: iroha_conf_loader.hpp:55
bool mst_support
Definition: iroha_conf_loader.hpp:54
std::string working_dbname
Definition: iroha_conf_loader.hpp:24
boost::optional< std::string > block_store_path
Definition: iroha_conf_loader.hpp:42
uint32_t vote_delay
Definition: iroha_conf_loader.hpp:53
std::string user
Definition: iroha_conf_loader.hpp:22
boost::optional< logger::LoggerManagerTreePtr > logger_manager
Definition: iroha_conf_loader.hpp:58
boost::optional< DbConfig > database_config
Definition: iroha_conf_loader.hpp:50
Definition: iroha_conf_loader.hpp:19
Definition: iroha_conf_loader.hpp:28
uint16_t torii_port
Definition: iroha_conf_loader.hpp:43
std::string path
Definition: iroha_conf_loader.hpp:30