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