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  struct UtilityService {
41  std::string ip;
42  uint16_t port;
43  };
44 
45  // TODO: block_store_path is now optional, change docs IR-576
46  // luckychess 29.06.2019
47  boost::optional<std::string> block_store_path;
48  uint16_t torii_port;
49  boost::optional<iroha::torii::TlsParams> torii_tls_params;
50  boost::optional<InterPeerTls> inter_peer_tls;
51  uint16_t internal_port;
52  boost::optional<std::string>
53  pg_opt; // TODO 2019.06.26 mboldyrev IR-556 remove
54  boost::optional<DbConfig>
55  database_config; // TODO 2019.06.26 mboldyrev IR-556 make required
57  uint32_t proposal_delay;
58  uint32_t vote_delay;
60  boost::optional<uint32_t> mst_expiration_time;
61  boost::optional<uint32_t> max_round_delay_ms;
62  boost::optional<uint32_t> stale_stream_max_rounds;
63  boost::optional<logger::LoggerManagerTreePtr> logger_manager;
64  boost::optional<shared_model::interface::types::PeerList> initial_peers;
65  boost::optional<UtilityService> utility_service;
66 };
67 
74  const std::string &conf_path,
75  std::shared_ptr<shared_model::interface::CommonObjectsFactory>
76  common_objects_factory);
77 
78 #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:61
boost::variant< RootCert, FromWsv, None > PeerCertProvider
Definition: iroha_conf_loader.hpp:34
PeerCertProvider peer_certificates
Definition: iroha_conf_loader.hpp:37
uint16_t port
Definition: iroha_conf_loader.hpp:42
Definition: result_fwd.hpp:27
boost::optional< iroha::torii::TlsParams > torii_tls_params
Definition: iroha_conf_loader.hpp:49
Definition: iroha_conf_loader.hpp:40
boost::optional< uint32_t > stale_stream_max_rounds
Definition: iroha_conf_loader.hpp:62
boost::optional< InterPeerTls > inter_peer_tls
Definition: iroha_conf_loader.hpp:50
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:57
Definition: iroha_conf_loader.hpp:29
std::string ip
Definition: iroha_conf_loader.hpp:41
Definition: iroha_conf_loader.hpp:18
uint16_t internal_port
Definition: iroha_conf_loader.hpp:51
Definition: iroha_conf_loader.hpp:33
uint32_t max_proposal_size
Definition: iroha_conf_loader.hpp:56
boost::optional< std::string > pg_opt
Definition: iroha_conf_loader.hpp:53
boost::optional< shared_model::interface::types::PeerList > initial_peers
Definition: iroha_conf_loader.hpp:64
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:519
boost::optional< uint32_t > mst_expiration_time
Definition: iroha_conf_loader.hpp:60
bool mst_support
Definition: iroha_conf_loader.hpp:59
std::string working_dbname
Definition: iroha_conf_loader.hpp:24
boost::optional< std::string > block_store_path
Definition: iroha_conf_loader.hpp:47
uint32_t vote_delay
Definition: iroha_conf_loader.hpp:58
std::string user
Definition: iroha_conf_loader.hpp:22
boost::optional< logger::LoggerManagerTreePtr > logger_manager
Definition: iroha_conf_loader.hpp:63
boost::optional< DbConfig > database_config
Definition: iroha_conf_loader.hpp:55
Definition: iroha_conf_loader.hpp:19
Definition: iroha_conf_loader.hpp:28
uint16_t torii_port
Definition: iroha_conf_loader.hpp:48
std::string path
Definition: iroha_conf_loader.hpp:30
boost::optional< UtilityService > utility_service
Definition: iroha_conf_loader.hpp:65