6 #ifndef KAGOME_OFFCHAIN_WORKER_HPP 7 #define KAGOME_OFFCHAIN_WORKER_HPP 9 #include <boost/optional.hpp> 10 #include <libp2p/multi/multiaddress.hpp> 11 #include <libp2p/peer/peer_id.hpp> 35 virtual outcome::result<void>
run() = 0;
62 std::optional<common::BufferView> expected,
72 RequestId id, std::string_view name, std::string_view value) = 0;
77 std::optional<Timestamp> deadline) = 0;
80 const std::vector<RequestId> &ids,
81 std::optional<Timestamp> deadline) = 0;
83 virtual std::vector<std::pair<std::string, std::string>>
89 std::optional<Timestamp> deadline) = 0;
92 bool authorized_only) = 0;
virtual Timestamp timestamp()=0
Class represents arbitrary (including empty) byte buffer.
virtual Result< OpaqueNetworkState, Failure > networkState()=0
virtual void localStorageSet(StorageType storage_type, const common::BufferView &key, common::Buffer value)=0
virtual RandomSeed randomSeed()=0
virtual void sleepUntil(Timestamp)=0
virtual Result< RequestId, Failure > httpRequestStart(HttpMethod method, std::string_view uri, common::Buffer meta)=0
virtual Result< Success, Failure > submitTransaction(const primitives::Extrinsic &ext)=0
virtual ~OffchainWorker()=default
virtual outcome::result< void > run()=0
virtual Result< uint32_t, HttpError > httpResponseReadBody(RequestId id, common::Buffer &chunk, std::optional< Timestamp > deadline)=0
virtual bool localStorageCompareAndSet(StorageType storage_type, const common::BufferView &key, std::optional< common::BufferView > expected, common::Buffer value)=0
virtual void setAuthorizedNodes(std::vector< libp2p::peer::PeerId > nodes, bool authorized_only)=0
virtual std::vector< HttpStatus > httpResponseWait(const std::vector< RequestId > &ids, std::optional< Timestamp > deadline)=0
virtual outcome::result< common::Buffer > localStorageGet(StorageType storage_type, const common::BufferView &key)=0
virtual bool isValidator() const =0
virtual Result< Success, HttpError > httpRequestWriteBody(RequestId id, common::Buffer chunk, std::optional< Timestamp > deadline)=0
uint64_t Timestamp
Timestamp is milliseconds since UNIX Epoch.
virtual std::vector< std::pair< std::string, std::string > > httpResponseHeaders(RequestId id)=0
Extrinsic class represents extrinsic.
virtual void localStorageClear(StorageType storage_type, const common::BufferView &key)=0
virtual Result< Success, Failure > httpRequestAddHeader(RequestId id, std::string_view name, std::string_view value)=0