16 std::shared_ptr<boost::asio::io_context> io_context,
17 std::shared_ptr<crypto::Hasher> hasher,
18 std::shared_ptr<StreamEngine> stream_engine,
19 std::shared_ptr<primitives::events::ExtrinsicSubscriptionEngine>
20 extrinsic_events_engine,
21 std::shared_ptr<subscription::ExtrinsicEventKeyRepository>
23 std::shared_ptr<ReputationRepository> reputation_repository,
24 std::shared_ptr<libp2p::basic::Scheduler> scheduler)
26 app_config_(app_config),
27 chain_spec_(chain_spec),
29 io_context_(
std::move(io_context)),
30 hasher_(
std::move(hasher)),
31 stream_engine_(
std::move(stream_engine)),
32 extrinsic_events_engine_{std::move(extrinsic_events_engine)},
37 BOOST_ASSERT(
hasher_ !=
nullptr);
45 std::shared_ptr<BlockAnnounceProtocol>
47 return std::make_shared<BlockAnnounceProtocol>(
host_,
59 BOOST_ASSERT(block_tree !=
nullptr);
60 auto genesisBlockHash = block_tree->getGenesisBlockHash();
62 return std::make_shared<GrandpaProtocol>(
host_,
75 return std::make_shared<CollationProtocol>(
79 std::shared_ptr<ReqCollationProtocol>
81 return std::make_shared<ReqCollationProtocol>(
85 std::shared_ptr<PropagateTransactionsProtocol>
87 return std::make_shared<PropagateTransactionsProtocol>(
99 return std::make_shared<StateProtocolImpl>(
104 return std::make_shared<SyncProtocolImpl>(
std::shared_ptr< GrandpaProtocol > makeGrandpaProtocol() const
std::weak_ptr< consensus::grandpa::GrandpaObserver > grandpa_observer_
std::shared_ptr< CollationProtocol > makeCollationProtocol() const
std::shared_ptr< StateProtocol > makeStateProtocol() const
const OwnPeerInfo & own_info_
std::weak_ptr< StateProtocolObserver > state_observer_
std::weak_ptr< consensus::babe::Babe > babe_
std::weak_ptr< ReqCollationObserver > req_collation_observer_
std::shared_ptr< ReqCollationProtocol > makeReqCollationProtocol() const
std::weak_ptr< ExtrinsicObserver > extrinsic_observer_
ProtocolFactory(libp2p::Host &host, const application::AppConfiguration &app_config, const application::ChainSpec &chain_spec, const OwnPeerInfo &own_info, std::shared_ptr< boost::asio::io_context > io_context, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< StreamEngine > stream_engine, std::shared_ptr< primitives::events::ExtrinsicSubscriptionEngine > extrinsic_events_engine, std::shared_ptr< subscription::ExtrinsicEventKeyRepository > ext_event_key_repo, std::shared_ptr< ReputationRepository > reputation_repository, std::shared_ptr< libp2p::basic::Scheduler > scheduler)
std::weak_ptr< PeerManager > peer_manager_
std::shared_ptr< StreamEngine > stream_engine_
std::weak_ptr< blockchain::BlockTree > block_tree_
std::shared_ptr< SyncProtocol > makeSyncProtocol() const
std::shared_ptr< primitives::events::ExtrinsicSubscriptionEngine > extrinsic_events_engine_
std::weak_ptr< SyncProtocolObserver > sync_observer_
std::shared_ptr< PropagateTransactionsProtocol > makePropagateTransactionsProtocol() const
std::weak_ptr< CollationObserver > collation_observer_
const application::ChainSpec & chain_spec_
const application::AppConfiguration & app_config_
std::shared_ptr< BlockAnnounceProtocol > makeBlockAnnounceProtocol() const
std::shared_ptr< boost::asio::io_context > io_context_
std::shared_ptr< crypto::Hasher > hasher_
std::shared_ptr< libp2p::basic::Scheduler > scheduler_
std::shared_ptr< subscription::ExtrinsicEventKeyRepository > ext_event_key_repo_
std::shared_ptr< ReputationRepository > reputation_repository_