Kagome
Polkadot Runtime Engine in C++17
offchain_worker_factory_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_OFFCHAIN_OFFCHAINWORKERFACTORYIMPL
7 #define KAGOME_OFFCHAIN_OFFCHAINWORKERFACTORYIMPL
8 
10 
11 #include <libp2p/host/host.hpp>
12 
16 
17 namespace kagome::api {
18  class AuthorApi;
19 }
20 namespace kagome::application {
21  class AppConfiguration;
22 }
23 namespace kagome::crypto {
24  class Hasher;
25 }
26 namespace kagome::runtime {
27  class Executor;
28 }
29 
30 namespace kagome::offchain {
31  class OffchainWorkerPool;
33  public:
35  const application::AppConfiguration &app_config,
36  std::shared_ptr<clock::SystemClock> clock,
37  std::shared_ptr<crypto::Hasher> hasher,
38  std::shared_ptr<storage::BufferStorage> storage,
39  std::shared_ptr<crypto::CSPRNG> random_generator,
40  std::shared_ptr<api::AuthorApi> author_api,
41  const network::OwnPeerInfo &current_peer_info,
42  std::shared_ptr<offchain::OffchainPersistentStorage> persistent_storage,
43  std::shared_ptr<offchain::OffchainWorkerPool> offchain_worker_pool);
44 
45  std::shared_ptr<OffchainWorker> make(
46  std::shared_ptr<runtime::Executor> executor,
47  const primitives::BlockHeader &header) override;
48 
49  private:
51  std::shared_ptr<clock::SystemClock> clock_;
52  std::shared_ptr<crypto::Hasher> hasher_;
53  std::shared_ptr<storage::BufferStorage> storage_;
54  std::shared_ptr<crypto::CSPRNG> random_generator_;
55  std::shared_ptr<api::AuthorApi> author_api_;
57  std::shared_ptr<offchain::OffchainPersistentStorage> persistent_storage_;
58  std::shared_ptr<offchain::OffchainWorkerPool> offchain_worker_pool_;
59  };
60 
61 } // namespace kagome::offchain
62 
63 #endif // KAGOME_OFFCHAIN_OFFCHAINWORKERFACTORYIMPL
std::shared_ptr< offchain::OffchainPersistentStorage > persistent_storage_
std::shared_ptr< offchain::OffchainWorkerPool > offchain_worker_pool_
std::shared_ptr< storage::BufferStorage > storage_
const application::AppConfiguration & app_config_