Kagome
Polkadot Runtime Engine in C++17
|
#include <offchain_worker_impl.hpp>
Public Member Functions | |
OffchainWorkerImpl (const application::AppConfiguration &app_config, std::shared_ptr< clock::SystemClock > clock, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< storage::BufferStorage > storage, std::shared_ptr< crypto::CSPRNG > random_generator, std::shared_ptr< api::AuthorApi > author_api, const network::OwnPeerInfo ¤t_peer_info, std::shared_ptr< OffchainPersistentStorage > persistent_storage, std::shared_ptr< runtime::Executor > executor, const primitives::BlockHeader &header, std::shared_ptr< OffchainWorkerPool > ocw_pool) | |
outcome::result< void > | run () override |
bool | isValidator () const override |
Result< Success, Failure > | submitTransaction (const primitives::Extrinsic &ext) override |
Result< OpaqueNetworkState, Failure > | networkState () override |
Timestamp | timestamp () override |
void | sleepUntil (Timestamp timestamp) override |
RandomSeed | randomSeed () override |
void | localStorageSet (StorageType storage_type, const common::BufferView &key, common::Buffer value) override |
void | localStorageClear (StorageType storage_type, const common::BufferView &key) override |
bool | localStorageCompareAndSet (StorageType storage_type, const common::BufferView &key, std::optional< common::BufferView > expected, common::Buffer value) override |
outcome::result< common::Buffer > | localStorageGet (StorageType storage_type, const common::BufferView &key) override |
Result< RequestId, Failure > | httpRequestStart (HttpMethod method, std::string_view uri, common::Buffer meta) override |
Result< Success, Failure > | httpRequestAddHeader (RequestId id, std::string_view name, std::string_view value) override |
Result< Success, HttpError > | httpRequestWriteBody (RequestId id, common::Buffer chunk, std::optional< Timestamp > deadline) override |
std::vector< HttpStatus > | httpResponseWait (const std::vector< RequestId > &ids, std::optional< Timestamp > deadline) override |
std::vector< std::pair< std::string, std::string > > | httpResponseHeaders (RequestId id) override |
Result< uint32_t, HttpError > | httpResponseReadBody (RequestId id, common::Buffer &chunk, std::optional< Timestamp > deadline) override |
void | setAuthorizedNodes (std::vector< libp2p::peer::PeerId > nodes, bool authorized_only) override |
Public Member Functions inherited from kagome::offchain::OffchainWorker | |
virtual | ~OffchainWorker ()=default |
Static Public Attributes | |
static constexpr auto | latency_of_waiting = 1ms |
Private Member Functions | |
OffchainStorage & | getStorage (StorageType storage_type) |
Private Attributes | |
const application::AppConfiguration & | app_config_ |
std::shared_ptr< clock::SystemClock > | clock_ |
std::shared_ptr< crypto::Hasher > | hasher_ |
std::shared_ptr< crypto::CSPRNG > | random_generator_ |
std::shared_ptr< api::AuthorApi > | author_api_ |
const network::OwnPeerInfo & | current_peer_info_ |
std::shared_ptr< offchain::OffchainPersistentStorage > | persistent_storage_ |
std::shared_ptr< offchain::OffchainLocalStorage > | local_storage_ |
std::shared_ptr< runtime::Executor > | executor_ |
const primitives::BlockHeader | header_ |
const primitives::BlockInfo | block_ |
std::shared_ptr< OffchainWorkerPool > | ocw_pool_ |
log::Logger | log_ |
int16_t | request_id_ = 0 |
std::map< RequestId, std::shared_ptr< HttpRequest > > | active_http_requests_ |
Definition at line 38 of file offchain_worker_impl.hpp.
kagome::offchain::OffchainWorkerImpl::OffchainWorkerImpl | ( | const application::AppConfiguration & | app_config, |
std::shared_ptr< clock::SystemClock > | clock, | ||
std::shared_ptr< crypto::Hasher > | hasher, | ||
std::shared_ptr< storage::BufferStorage > | storage, | ||
std::shared_ptr< crypto::CSPRNG > | random_generator, | ||
std::shared_ptr< api::AuthorApi > | author_api, | ||
const network::OwnPeerInfo & | current_peer_info, | ||
std::shared_ptr< OffchainPersistentStorage > | persistent_storage, | ||
std::shared_ptr< runtime::Executor > | executor, | ||
const primitives::BlockHeader & | header, | ||
std::shared_ptr< OffchainWorkerPool > | ocw_pool | ||
) |
Definition at line 22 of file offchain_worker_impl.cpp.
|
private |
Definition at line 152 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 240 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 221 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 253 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 303 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 316 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 273 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 103 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 184 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 194 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 210 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 174 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 118 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 146 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 63 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 336 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 132 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 108 of file offchain_worker_impl.cpp.
|
overridevirtual |
Implements kagome::offchain::OffchainWorker.
Definition at line 126 of file offchain_worker_impl.cpp.
|
private |
Definition at line 134 of file offchain_worker_impl.hpp.
|
private |
Definition at line 119 of file offchain_worker_impl.hpp.
|
private |
Definition at line 123 of file offchain_worker_impl.hpp.
|
private |
Definition at line 129 of file offchain_worker_impl.hpp.
|
private |
Definition at line 120 of file offchain_worker_impl.hpp.
|
private |
Definition at line 124 of file offchain_worker_impl.hpp.
|
private |
Definition at line 127 of file offchain_worker_impl.hpp.
|
private |
Definition at line 121 of file offchain_worker_impl.hpp.
|
private |
Definition at line 128 of file offchain_worker_impl.hpp.
|
static |
Definition at line 44 of file offchain_worker_impl.hpp.
|
private |
Definition at line 126 of file offchain_worker_impl.hpp.
|
private |
Definition at line 131 of file offchain_worker_impl.hpp.
|
private |
Definition at line 130 of file offchain_worker_impl.hpp.
|
private |
Definition at line 125 of file offchain_worker_impl.hpp.
|
private |
Definition at line 122 of file offchain_worker_impl.hpp.
|
private |
Definition at line 133 of file offchain_worker_impl.hpp.