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 
14 #include "consensus/yac/timer.hpp"
16 #include "consensus/yac/yac.hpp"
20 #include "cryptography/keypair.hpp"
23 #include "network/block_loader.hpp"
26 
27 namespace iroha {
28  namespace consensus {
29  namespace yac {
30 
31  class YacInit {
32  public:
33  std::shared_ptr<YacGate> initConsensusGate(
34  Round initial_round,
35  // TODO 30.01.2019 lebdron: IR-262 Remove PeerQueryFactory
36  std::shared_ptr<ametsuchi::PeerQueryFactory> peer_query_factory,
37  std::shared_ptr<simulator::BlockCreator> block_creator,
38  std::shared_ptr<network::BlockLoader> block_loader,
39  const shared_model::crypto::Keypair &keypair,
40  std::shared_ptr<consensus::ConsensusResultCache> block_cache,
41  std::chrono::milliseconds vote_delay_milliseconds,
42  std::shared_ptr<
44  async_call,
45  std::shared_ptr<shared_model::interface::CommonObjectsFactory>
46  common_objects_factory,
47  ConsistencyModel consistency_model,
48  const logger::LoggerManagerTreePtr &consensus_log_manager);
49 
50  std::shared_ptr<NetworkImpl> getConsensusNetwork() const;
51 
52  private:
53  auto createTimer(std::chrono::milliseconds delay_milliseconds);
54 
55  bool initialized_{false};
56  std::shared_ptr<NetworkImpl> consensus_network_;
57  };
58  } // namespace yac
59  } // namespace consensus
60 } // namespace iroha
61 
62 #endif // IROHA_CONSENSUS_INIT_HPP
Definition: consensus_init.hpp:31
Definition: keypair.hpp:19
std::shared_ptr< NetworkImpl > getConsensusNetwork() const
Definition: consensus_init.cpp:75
std::shared_ptr< YacGate > initConsensusGate(Round initial_round, std::shared_ptr< ametsuchi::PeerQueryFactory > peer_query_factory, std::shared_ptr< simulator::BlockCreator > block_creator, std::shared_ptr< network::BlockLoader > block_loader, const shared_model::crypto::Keypair &keypair, std::shared_ptr< consensus::ConsensusResultCache > block_cache, std::chrono::milliseconds vote_delay_milliseconds, std::shared_ptr< iroha::network::AsyncGrpcClient< google::protobuf::Empty >> async_call, std::shared_ptr< shared_model::interface::CommonObjectsFactory > common_objects_factory, ConsistencyModel consistency_model, const logger::LoggerManagerTreePtr &consensus_log_manager)
Definition: consensus_init.cpp:89
Definition: block_query.hpp:16
std::shared_ptr< LoggerManagerTree > LoggerManagerTreePtr
Definition: logger_manager_fwd.hpp:14
ConsistencyModel
Definition: consistency_model.hpp:13
Definition: round.hpp:31
Definition: async_grpc_client.hpp:25