Kagome
Polkadot Runtime Engine in C++17
parachain_observer.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_PARACHAIN_OBSERVER_HPP
7 #define KAGOME_PARACHAIN_OBSERVER_HPP
8 
11 
12 #include <memory>
13 
15 
16 namespace kagome::network {
17  class PeerManager;
18 }
19 
20 namespace kagome::observers {
21  struct CollationObserverImpl;
22  struct ReqCollationObserverImpl;
23 } // namespace kagome::observers
24 
25 namespace kagome::crypto {
26  class Sr25519Provider;
27 }
28 
29 namespace kagome::parachain {
30  struct ParachainProcessorImpl;
31 }
32 
33 namespace kagome::parachain {
34 
38  std::shared_ptr<network::PeerManager> pm,
39  std::shared_ptr<crypto::Sr25519Provider> crypto_provider,
40  std::shared_ptr<parachain::ParachainProcessorImpl> processor);
41  ~ParachainObserverImpl() = default;
42 
44  void onAdvertise(libp2p::peer::PeerId const &peer_id,
45  primitives::BlockHash para_hash) override;
46  void onDeclare(libp2p::peer::PeerId const &peer_id,
48  network::ParachainId para_id,
49  network::Signature signature) override;
50 
52  outcome::result<network::CollationFetchingResponse> OnCollationRequest(
53  network::CollationFetchingRequest request) override;
54 
55  private:
56  std::shared_ptr<observers::CollationObserverImpl> collation_observer_impl_;
57  std::shared_ptr<observers::ReqCollationObserverImpl>
59  std::shared_ptr<parachain::ParachainProcessorImpl> processor_;
60  };
61 
62 } // namespace kagome::parachain
63 
64 #endif // KAGOME_PARACHAIN_OBSERVER_HPP
crypto::Sr25519PublicKey CollatorPublicKey
libp2p::peer::PeerId PeerId
std::shared_ptr< observers::ReqCollationObserverImpl > req_collation_observer_impl_
std::shared_ptr< parachain::ParachainProcessorImpl > processor_
crypto::Sr25519Signature Signature
std::shared_ptr< observers::CollationObserverImpl > collation_observer_impl_