Kagome
Polkadot Runtime Engine in C++17
kagome::offchain Namespace Reference

Classes

struct  Failure
 
class  HttpRequest
 
struct  NoPayload
 
class  OffchainLocalStorage
 It is revertible and fork-aware. It means that any value set by the offchain worker triggered at a certain block is reverted if that block is reverted as non-canonical. The value is NOT available for the worker that is re-run at the next or any future blocks. More...
 
class  OffchainLocalStorageImpl
 
class  OffchainPersistentStorage
 It is non-revertible and not fork-aware. It means that any value set by the offchain worker is persisted even if that block (at which the worker is called) is reverted as non-canonical (meaning that the block was surpassed by a longer chain). The value is available for the worker that is re-run at the new (different block with the same block number) and future blocks. This storage can be used by offchain workers to handle forks and coordinate offchain workers running on different forks. More...
 
class  OffchainPersistentStorageImpl
 
class  OffchainStorage
 
class  OffchainWorker
 
class  OffchainWorkerFactory
 
class  OffchainWorkerFactoryImpl
 
class  OffchainWorkerImpl
 
class  OffchainWorkerPool
 
class  OffchainWorkerPoolImpl
 
struct  OpaqueNetworkState
 
struct  Result
 
struct  Success
 

Typedefs

using Timestamp = uint64_t
 Timestamp is milliseconds since UNIX Epoch. More...
 
using RandomSeed = common::Blob< 32 >
 
using RequestId = int16_t
 
using HttpStatus = uint16_t
 HTTP status codes that can get returned by certain Offchain funcs. 0: the specified request identifier is invalid. 10: the deadline for the started request was reached. 20: an error has occurred during the request, e.g. a timeout or the remote server has closed the connection. On returning this error code, the request is considered destroyed and must be reconstructed again. 100-999: the request has finished with the given HTTP status code. More...
 

Enumerations

enum  StorageType : int32_t { StorageType::Undefined = 0, StorageType::Persistent = 1, StorageType::Local = 2 }
 
enum  HttpMethod { HttpMethod::Undefined = 0, HttpMethod::Get = 1, HttpMethod::Post = 2 }
 
enum  HttpError : int32_t { HttpError::Timeout = 0, HttpError::IoError = 1, HttpError::InvalidId = 2 }
 

Functions

constexpr HttpStatus InvalidIdentifier (0)
 
constexpr HttpStatus DeadlineHasReached (10)
 
constexpr HttpStatus ErrorHasOccurred (20)
 
 SCALE_EMPTY_CODER (NoPayload)
 
template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream & operator<< (Stream &s, const OpaqueNetworkState &v)
 
template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream & operator>> (Stream &s, OpaqueNetworkState &v)
 

Detailed Description

Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Typedef Documentation

using kagome::offchain::HttpStatus = typedef uint16_t

HTTP status codes that can get returned by certain Offchain funcs. 0: the specified request identifier is invalid. 10: the deadline for the started request was reached. 20: an error has occurred during the request, e.g. a timeout or the remote server has closed the connection. On returning this error code, the request is considered destroyed and must be reconstructed again. 100-999: the request has finished with the given HTTP status code.

Definition at line 46 of file types.hpp.

Definition at line 23 of file types.hpp.

using kagome::offchain::RequestId = typedef int16_t

Definition at line 29 of file types.hpp.

using kagome::offchain::Timestamp = typedef uint64_t

Timestamp is milliseconds since UNIX Epoch.

Definition at line 21 of file types.hpp.

Enumeration Type Documentation

enum kagome::offchain::HttpError : int32_t
strong
Enumerator
Timeout 

The deadline was reached.

IoError 

There was an IO error while processing the request.

InvalidId 

The ID of the request is invalid.

Definition at line 31 of file types.hpp.

Enumerator
Undefined 
Get 
Post 

Definition at line 27 of file types.hpp.

enum kagome::offchain::StorageType : int32_t
strong
Enumerator
Undefined 
Persistent 
Local 

Definition at line 25 of file types.hpp.

Function Documentation

constexpr HttpStatus kagome::offchain::DeadlineHasReached ( 10  )
constexpr HttpStatus kagome::offchain::ErrorHasOccurred ( 20  )
constexpr HttpStatus kagome::offchain::InvalidIdentifier ( )
template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream& kagome::offchain::operator<< ( Stream &  s,
const OpaqueNetworkState v 
)

Definition at line 90 of file types.hpp.

template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream& kagome::offchain::operator>> ( Stream &  s,
OpaqueNetworkState v 
)

Definition at line 104 of file types.hpp.

kagome::offchain::SCALE_EMPTY_CODER ( NoPayload  )