hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
on_demand_ordering_init.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_ON_DEMAND_ORDERING_INIT_HPP
7 #define IROHA_ON_DEMAND_ORDERING_INIT_HPP
8 
9 #include <chrono>
10 #include <vector>
11 
12 #include <rxcpp/rx-lite.hpp>
14 #include "logger/logger_fwd.hpp"
16 
17 namespace google {
18  namespace protobuf {
19  class Empty;
20  }
21 } // namespace google
22 
23 namespace grpc {
24  class Service;
25 }
26 
27 namespace shared_model {
28  namespace interface {
29  class Proposal;
30  class Transaction;
31  class Block;
32  template <typename Interface, typename Transport>
37  } // namespace interface
38 } // namespace shared_model
39 
40 namespace iroha {
41  namespace network {
42  class GenericClientFactory;
43  template <typename Response>
45  class OrderingGate;
46  } // namespace network
47  namespace protocol {
48  class Proposal;
49  class Transaction;
50  } // namespace protocol
51  namespace ametsuchi {
52  class TxPresenceCache;
53  }
54  namespace synchronizer {
55  struct SynchronizationEvent;
56  }
57  namespace ordering {
60  namespace transport {
61  class OdOsNotification;
62  }
63  namespace cache {
64  class OrderingGateCache;
65  }
66 
71  public:
72  using TransportFactoryType =
75  iroha::protocol::Proposal>;
76 
77  private:
83  auto createConnectionManager(
85  async_call,
86  std::shared_ptr<TransportFactoryType> proposal_transport_factory,
87  std::chrono::milliseconds delay,
88  std::vector<shared_model::interface::types::HashType> initial_hashes,
89  const logger::LoggerManagerTreePtr &ordering_log_manager,
90  std::shared_ptr<iroha::network::GenericClientFactory> client_factory);
91 
96  auto createGate(
97  std::shared_ptr<OnDemandOrderingService> ordering_service,
98  std::unique_ptr<transport::OdOsNotification> network_client,
99  std::shared_ptr<shared_model::interface::UnsafeProposalFactory>
100  proposal_factory,
101  std::shared_ptr<ametsuchi::TxPresenceCache> tx_cache,
102  std::shared_ptr<ProposalCreationStrategy> creation_strategy,
103  size_t max_number_of_transactions,
104  const logger::LoggerManagerTreePtr &ordering_log_manager);
105 
110  auto createService(
111  size_t max_number_of_transactions,
112  std::shared_ptr<shared_model::interface::UnsafeProposalFactory>
113  proposal_factory,
114  std::shared_ptr<ametsuchi::TxPresenceCache> tx_cache,
115  std::shared_ptr<ProposalCreationStrategy> creation_strategy,
116  const logger::LoggerManagerTreePtr &ordering_log_manager);
117 
118  rxcpp::composite_subscription sync_event_notifier_lifetime_;
119  rxcpp::composite_subscription commit_notifier_lifetime_;
120 
121  public:
125 
127 
151  std::shared_ptr<network::OrderingGate> initOrderingGate(
152  size_t max_number_of_transactions,
153  std::chrono::milliseconds delay,
154  std::vector<shared_model::interface::types::HashType> initial_hashes,
157  iroha::protocol::Transaction>> transaction_factory,
158  std::shared_ptr<shared_model::interface::TransactionBatchParser>
159  batch_parser,
160  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
161  transaction_batch_factory,
163  async_call,
164  std::shared_ptr<shared_model::interface::UnsafeProposalFactory>
165  proposal_factory,
166  std::shared_ptr<TransportFactoryType> proposal_transport_factory,
167  std::shared_ptr<ametsuchi::TxPresenceCache> tx_cache,
168  std::shared_ptr<ProposalCreationStrategy> creation_strategy,
169  logger::LoggerManagerTreePtr ordering_log_manager,
170  std::shared_ptr<iroha::network::GenericClientFactory> client_factory);
171 
173  std::shared_ptr<grpc::Service> service;
174 
176  rxcpp::subjects::subject<synchronizer::SynchronizationEvent>
178  rxcpp::subjects::subject<
179  std::shared_ptr<shared_model::interface::Block const>>
181 
182  private:
183  logger::LoggerPtr log_;
184  };
185  } // namespace ordering
186 } // namespace iroha
187 
188 #endif // IROHA_ON_DEMAND_ORDERING_INIT_HPP
rxcpp::subjects::subject< synchronizer::SynchronizationEvent > sync_event_notifier
commit notifier from peer communication service
Definition: on_demand_ordering_init.hpp:177
Definition: ordering_gate.hpp:28
Definition: on_demand_ordering_init.hpp:70
rxcpp::subjects::subject< std::shared_ptr< shared_model::interface::Block const > > commit_notifier
Definition: on_demand_ordering_init.hpp:180
Definition: unsafe_proposal_factory.hpp:22
Definition: on_demand_ordering_service.hpp:17
Definition: proposal.hpp:17
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: block_query.hpp:15
Definition: on_demand_ordering_init.hpp:23
Definition: ordering_service_proposal_creation_strategy.hpp:19
Definition: on_demand_os_transport.hpp:35
Definition: ordering_gate_cache.hpp:27
std::shared_ptr< LoggerManagerTree > LoggerManagerTreePtr
Definition: logger_manager_fwd.hpp:14
Definition: transaction_batch_parser.hpp:18
std::shared_ptr< grpc::Service > service
gRPC service for ordering service
Definition: on_demand_ordering_init.hpp:173
Definition: transaction_batch_factory.hpp:23
Definition: on_demand_ordering_init.hpp:17
Definition: on_demand_ordering_init.hpp:44
Definition: command_executor.hpp:12
Definition: on_demand_ordering_init.hpp:33
Definition: transaction.hpp:23