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

Namespaces

 author
 
 chain
 
 child_state
 
 details
 
 internal
 
 payment
 
 rpc
 
 state
 
 system
 

Classes

class  ApiService
 
class  ApiServiceImpl
 
class  AuthorApi
 
class  AuthorApiImpl
 
class  ChainApi
 
class  ChainApiImpl
 
class  ChildStateApi
 
class  ChildStateApiImpl
 
class  HttpListenerImpl
 server which listens for incoming connection, accepts connections making session from socket More...
 
class  HttpSession
 HTTP session for api service. More...
 
class  InternalApi
 
class  InternalApiImpl
 
class  JrpcHandleBatch
 
class  JRpcProcessor
 
class  JRpcServer
 
class  JRpcServerImpl
 
class  JsonWriter
 
class  Listener
 server which listens for incoming connection, accepts connections making session from socket More...
 
class  Method
 
struct  Parser
 
class  PaymentApi
 
class  PaymentApiImpl
 
class  RpcApi
 
class  RpcApiImpl
 
class  RpcContext
 
class  RpcThreadPool
 thread pool for serve RPC calls More...
 
class  Session
 rpc session More...
 
class  StateApi
 
class  StateApiImpl
 
class  SystemApi
 
class  SystemApiImpl
 
class  WsListenerImpl
 server which listens for incoming connection, accepts connections making session from socket More...
 
class  WsSession
 

Typedefs

template<typename T >
using UCachedType = std::unique_ptr< T, void(*)(T *const)>
 
using Acceptor = boost::asio::ip::tcp::acceptor
 
using Endpoint = boost::asio::ip::tcp::endpoint
 

Enumerations

enum  ApiTransportError { ApiTransportError::FAILED_SET_OPTION = 1, ApiTransportError::FAILED_START_LISTENING, ApiTransportError::LISTENER_ALREADY_STARTED, ApiTransportError::CANNOT_ACCEPT_LISTENER_NOT_WORKING }
 
enum  SessionType { SessionType::kHttp = 1, SessionType::kWs }
 

Functions

jsonrpc::Value makeValue (const uint32_t &)
 
jsonrpc::Value makeValue (const uint64_t &)
 
jsonrpc::Value makeValue (const std::nullptr_t &)
 
jsonrpc::Value makeValue (const std::nullopt_t &)
 
template<typename T >
jsonrpc::Value makeValue (const std::reference_wrapper< T > &v)
 
template<typename T >
jsonrpc::Value makeValue (const std::optional< T > &val)
 
template<typename... Ts>
jsonrpc::Value makeValue (const boost::variant< Ts... > &v)
 
template<typename T1 , typename T2 >
jsonrpc::Value makeValue (const std::pair< T1, T2 > &val)
 
template<typename T >
jsonrpc::Value makeValue (const std::vector< T > &)
 
template<size_t N>
jsonrpc::Value makeValue (const common::Blob< N > &)
 
jsonrpc::Value makeValue (const common::Buffer &)
 
jsonrpc::Value makeValue (common::BufferView)
 
jsonrpc::Value makeValue (const primitives::Extrinsic &)
 
jsonrpc::Value makeValue (const primitives::RuntimeDispatchInfo &v)
 
jsonrpc::Value makeValue (const primitives::DigestItem &)
 
jsonrpc::Value makeValue (const primitives::BlockData &)
 
jsonrpc::Value makeValue (const primitives::BlockHeader &)
 
jsonrpc::Value makeValue (const primitives::Version &)
 
jsonrpc::Value makeValue (const primitives::Justification &)
 
jsonrpc::Value makeValue (const primitives::RpcMethods &)
 
template<typename T >
jsonrpc::Value makeValue (const T &val)
 
template<typename T >
jsonrpc::Value makeValue (std::remove_reference_t< T > &&val)
 
jsonrpc::Value makeValue (const primitives::events::ExtrinsicLifecycleEvent &event)
 
 KAGOME_DEFINE_CACHE (api_service)
 
 KAGOME_DECLARE_CACHE (api_service, KAGOME_CACHE_UNIT(std::string), KAGOME_CACHE_UNIT(std::vector< UCachedType< std::string >>)) class JRpcProcessor
 
jsonrpc::Value makeValue (const StateApi::StorageChangeSet &changes)
 
std::unique_ptr< AcceptoracceptOnFreePort (std::shared_ptr< boost::asio::io_context > context, Endpoint endpoint, uint16_t port_tolerance, const log::Logger &logger)
 

Variables

const std::vector< crypto::KnownKeyTypeIdkKeyTypes
 
const std::string kRpcEventRuntimeVersion = "state_runtimeVersion"
 
const std::string kRpcEventNewHeads = "chain_newHead"
 
const std::string kRpcEventFinalizedHeads = "chain_finalizedHead"
 
const std::string kRpcEventSubscribeStorage = "state_storage"
 
const std::string kRpcEventUpdateExtrinsic = "author_extrinsicUpdate"
 
constexpr uint16_t kDefaultPortTolerance = 10
 

Detailed Description

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

Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 ExtrinsicSubmissionApi based on auth api implemented in substrate here https://github.com/paritytech/substrate/blob/e8739300ae3f7f2e7b72f64668573275f2806ea5/core/rpc/src/author/mod.rs#L50-L49

Typedef Documentation

using kagome::api::Acceptor = typedef boost::asio::ip::tcp::acceptor

Definition at line 19 of file tuner.hpp.

using kagome::api::Endpoint = typedef boost::asio::ip::tcp::endpoint

Definition at line 20 of file tuner.hpp.

template<typename T >
using kagome::api::UCachedType = typedef std::unique_ptr<T, void (*)(T *const)>

Definition at line 58 of file api_service_impl.hpp.

Enumeration Type Documentation

Enumerator
FAILED_SET_OPTION 
FAILED_START_LISTENING 
LISTENER_ALREADY_STARTED 
CANNOT_ACCEPT_LISTENER_NOT_WORKING 

Definition at line 12 of file error.hpp.

Enumerator
kHttp 
kWs 

Definition at line 19 of file session.hpp.

Function Documentation

std::unique_ptr< Acceptor > kagome::api::acceptOnFreePort ( std::shared_ptr< boost::asio::io_context >  context,
Endpoint  endpoint,
uint16_t  port_tolerance,
const log::Logger logger 
)

Definition at line 10 of file tuner.cpp.

kagome::api::KAGOME_DECLARE_CACHE ( api_service  ,
KAGOME_CACHE_UNIT(std::string)  ,
KAGOME_CACHE_UNIT(std::vector< UCachedType< std::string >>)   
)
kagome::api::KAGOME_DEFINE_CACHE ( api_service  )
jsonrpc::Value kagome::api::makeValue ( const StateApi::StorageChangeSet changes)
inline

Definition at line 19 of file query_storage.hpp.

jsonrpc::Value kagome::api::makeValue ( const uint32_t &  val)
inline

Definition at line 71 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const uint64_t &  val)
inline

Definition at line 75 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const std::nullptr_t &  )
inline

Definition at line 79 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const std::nullopt_t &  )
inline

Definition at line 83 of file value_converter.hpp.

template<typename T >
jsonrpc::Value kagome::api::makeValue ( const std::reference_wrapper< T > &  v)
inline

Definition at line 99 of file value_converter.hpp.

template<typename T >
jsonrpc::Value kagome::api::makeValue ( const std::optional< T > &  val)
inline

Definition at line 104 of file value_converter.hpp.

template<typename... Ts>
jsonrpc::Value kagome::api::makeValue ( const boost::variant< Ts... > &  v)
inline

Definition at line 110 of file value_converter.hpp.

template<typename T1 , typename T2 >
jsonrpc::Value kagome::api::makeValue ( const std::pair< T1, T2 > &  val)
inline

Definition at line 116 of file value_converter.hpp.

template<typename T >
jsonrpc::Value kagome::api::makeValue ( const std::vector< T > &  v)
inline

Definition at line 127 of file value_converter.hpp.

template<size_t N>
jsonrpc::Value kagome::api::makeValue ( const common::Blob< N > &  val)
inline

Definition at line 139 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const common::Buffer val)
inline

Definition at line 143 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( common::BufferView  val)
inline

Definition at line 147 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::Extrinsic v)
inline

Definition at line 309 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::RuntimeDispatchInfo v)
inline

Definition at line 236 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::DigestItem val)
inline

Definition at line 151 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::BlockData val)
inline

Definition at line 225 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::BlockHeader val)
inline

Definition at line 186 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::Version val)
inline

Definition at line 159 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::Justification val)
inline

Definition at line 209 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::RpcMethods v)
inline

Definition at line 218 of file value_converter.hpp.

template<typename T >
jsonrpc::Value kagome::api::makeValue ( const T &  val)
inline

Definition at line 88 of file value_converter.hpp.

template<typename T >
jsonrpc::Value kagome::api::makeValue ( std::remove_reference_t< T > &&  val)
inline

Definition at line 94 of file value_converter.hpp.

jsonrpc::Value kagome::api::makeValue ( const primitives::events::ExtrinsicLifecycleEvent event)
inline

Definition at line 255 of file value_converter.hpp.

Variable Documentation

constexpr uint16_t kagome::api::kDefaultPortTolerance = 10

Definition at line 17 of file tuner.hpp.

const std::string kagome::api::kRpcEventFinalizedHeads = "chain_finalizedHead"

Definition at line 114 of file api_service_impl.cpp.

const std::string kagome::api::kRpcEventNewHeads = "chain_newHead"

Definition at line 113 of file api_service_impl.cpp.

const std::string kagome::api::kRpcEventRuntimeVersion = "state_runtimeVersion"

Definition at line 112 of file api_service_impl.cpp.

const std::string kagome::api::kRpcEventSubscribeStorage = "state_storage"

Definition at line 115 of file api_service_impl.cpp.

const std::string kagome::api::kRpcEventUpdateExtrinsic = "author_extrinsicUpdate"

Definition at line 117 of file api_service_impl.cpp.