hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
consensus_init.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CONSENSUS_INIT_HPP
7 #define IROHA_CONSENSUS_INIT_HPP
8 
9 #include <memory>
10 
16 #include "consensus/yac/timer.hpp"
21 #include "cryptography/keypair.hpp"
23 #include "network/block_loader.hpp"
26 
27 namespace iroha {
28  namespace network {
29  class GenericClientFactory;
30  }
31  namespace consensus {
32  namespace yac {
33 
34  class YacInit {
35  public:
36  std::shared_ptr<YacGate> initConsensusGate(
37  Round initial_round,
38  // TODO 30.01.2019 lebdron: IR-262 Remove PeerQueryFactory
39  std::shared_ptr<ametsuchi::PeerQueryFactory> peer_query_factory,
40  boost::optional<shared_model::interface::types::PeerList>
41  alternative_peers,
42  std::shared_ptr<const LedgerState> ledger_state,
43  std::shared_ptr<simulator::BlockCreator> block_creator,
44  std::shared_ptr<network::BlockLoader> block_loader,
45  const shared_model::crypto::Keypair &keypair,
46  std::shared_ptr<consensus::ConsensusResultCache> block_cache,
47  std::chrono::milliseconds vote_delay_milliseconds,
48  std::shared_ptr<
50  async_call,
51  ConsistencyModel consistency_model,
52  const logger::LoggerManagerTreePtr &consensus_log_manager,
53  std::chrono::milliseconds delay,
54  std::shared_ptr<iroha::network::GenericClientFactory>
55  client_factory);
56 
57  std::shared_ptr<NetworkImpl> getConsensusNetwork() const;
58 
59  private:
60  auto createTimer(std::chrono::milliseconds delay_milliseconds);
61 
62  bool initialized_{false};
63  std::shared_ptr<NetworkImpl> consensus_network_;
64  };
65  } // namespace yac
66  } // namespace consensus
67 } // namespace iroha
68 
69 #endif // IROHA_CONSENSUS_INIT_HPP
Definition: consensus_init.hpp:34
Definition: keypair.hpp:19
Definition: block_query.hpp:15
std::shared_ptr< LoggerManagerTree > LoggerManagerTreePtr
Definition: logger_manager_fwd.hpp:14
ConsistencyModel
Definition: consistency_model.hpp:13
Definition: round.hpp:31
Definition: on_demand_ordering_init.hpp:44