Kagome
Polkadot Runtime Engine in C++17
|
#include <api_service_impl.hpp>
Classes | |
struct | ListenerList |
struct | ProcessorSpan |
struct | SessionSubscriptions |
Public Types | |
template<class T > | |
using | sptr = std::shared_ptr< T > |
Public Types inherited from kagome::api::ApiService | |
using | PubsubSubscriptionId = uint32_t |
subscription id for pubsub API methods More... | |
template<class T > | |
using | sptr = std::shared_ptr< T > |
Public Member Functions | |
ApiServiceImpl (const std::shared_ptr< application::AppStateManager > &app_state_manager, std::shared_ptr< api::RpcThreadPool > thread_pool, ListenerList listeners, std::shared_ptr< JRpcServer > server, const ProcessorSpan &processors, StorageSubscriptionEnginePtr storage_sub_engine, ChainSubscriptionEnginePtr chain_sub_engine, ExtrinsicSubscriptionEnginePtr ext_sub_engine, std::shared_ptr< subscription::ExtrinsicEventKeyRepository > extrinsic_event_key_repo, std::shared_ptr< blockchain::BlockTree > block_tree, std::shared_ptr< storage::trie::TrieStorage > trie_storage, std::shared_ptr< runtime::Core > core) | |
~ApiServiceImpl () override=default | |
bool | prepare () override |
bool | start () override |
void | stop () override |
outcome::result< uint32_t > | subscribeSessionToKeys (const std::vector< common::Buffer > &keys) override |
outcome::result< bool > | unsubscribeSessionFromIds (const std::vector< PubsubSubscriptionId > &subscription_id) override |
outcome::result< PubsubSubscriptionId > | subscribeFinalizedHeads () override |
outcome::result< bool > | unsubscribeFinalizedHeads (PubsubSubscriptionId subscription_id) override |
outcome::result< PubsubSubscriptionId > | subscribeNewHeads () override |
outcome::result< bool > | unsubscribeNewHeads (PubsubSubscriptionId subscription_id) override |
outcome::result< PubsubSubscriptionId > | subscribeRuntimeVersion () override |
outcome::result< bool > | unsubscribeRuntimeVersion (PubsubSubscriptionId subscription_id) override |
outcome::result< PubsubSubscriptionId > | subscribeForExtrinsicLifecycle (const primitives::Transaction::Hash &tx_hash) override |
outcome::result< bool > | unsubscribeFromExtrinsicLifecycle (PubsubSubscriptionId subscription_id) override |
Public Member Functions inherited from kagome::api::ApiService | |
virtual | ~ApiService ()=default |
Private Attributes | |
std::shared_ptr< api::RpcThreadPool > | thread_pool_ |
std::vector< sptr< Listener > > | listeners_ |
std::shared_ptr< JRpcServer > | server_ |
log::Logger | logger_ |
std::shared_ptr< blockchain::BlockTree > | block_tree_ |
std::shared_ptr< storage::trie::TrieStorage > | trie_storage_ |
std::shared_ptr< runtime::Core > | core_ |
std::mutex | subscribed_sessions_cs_ |
std::unordered_map< Session::SessionId, std::shared_ptr< SessionSubscriptions > > | subscribed_sessions_ |
struct { | |
StorageSubscriptionEnginePtr | storage |
ChainSubscriptionEnginePtr | chain |
ExtrinsicSubscriptionEnginePtr | ext |
} | subscription_engines_ |
std::shared_ptr< subscription::ExtrinsicEventKeyRepository > | extrinsic_event_key_repo_ |
Service listening for incoming JSON RPC request
Definition at line 69 of file api_service_impl.hpp.
struct kagome::api::ApiServiceImpl::ListenerList |
Definition at line 117 of file api_service_impl.hpp.
Class Members | ||
---|---|---|
vector< sptr< Listener > > | listeners |
struct kagome::api::ApiServiceImpl::ProcessorSpan |
Definition at line 120 of file api_service_impl.hpp.
Class Members | ||
---|---|---|
span< sptr< JRpcProcessor > > | processors |
struct kagome::api::ApiServiceImpl::SessionSubscriptions |
Definition at line 100 of file api_service_impl.hpp.
Class Members | ||
---|---|---|
typedef vector < AdditionMessageType > |
AdditionMessagesList | |
typedef decltype(KAGOME_EXTRACT_UNIQUE_CACHE(api_service, string)) |
AdditionMessageType | |
typedef decltype(KAGOME_EXTRACT_SHARED_CACHE(api_service, AdditionMessagesList)) |
CachedAdditionMessagesList |
Class Members | ||
---|---|---|
ChainEventSubscriberPtr | chain_sub | |
ExtrinsicEventSubscriberPtr | ext_sub | |
CachedAdditionMessagesList | messages | |
StorageEventSubscriberPtr | storage_sub |
|
private |
Definition at line 98 of file api_service_impl.hpp.
|
private |
Definition at line 83 of file api_service_impl.hpp.
|
private |
Definition at line 72 of file api_service_impl.hpp.
|
private |
Definition at line 78 of file api_service_impl.hpp.
|
private |
Definition at line 85 of file api_service_impl.hpp.
|
private |
Definition at line 76 of file api_service_impl.hpp.
|
private |
Definition at line 88 of file api_service_impl.hpp.
|
private |
Definition at line 82 of file api_service_impl.hpp.
|
private |
subscription id for pubsub API methods
Definition at line 96 of file api_service_impl.hpp.
|
private |
Definition at line 90 of file api_service_impl.hpp.
using kagome::api::ApiServiceImpl::sptr = std::shared_ptr<T> |
Definition at line 115 of file api_service_impl.hpp.
|
private |
Definition at line 86 of file api_service_impl.hpp.
|
private |
Definition at line 74 of file api_service_impl.hpp.
|
private |
Definition at line 80 of file api_service_impl.hpp.
subscription set id from subscription::SubscriptionEngine
Definition at line 93 of file api_service_impl.hpp.
kagome::api::ApiServiceImpl::ApiServiceImpl | ( | const std::shared_ptr< application::AppStateManager > & | app_state_manager, |
std::shared_ptr< api::RpcThreadPool > | thread_pool, | ||
ListenerList | listeners, | ||
std::shared_ptr< JRpcServer > | server, | ||
const ProcessorSpan & | processors, | ||
StorageSubscriptionEnginePtr | storage_sub_engine, | ||
ChainSubscriptionEnginePtr | chain_sub_engine, | ||
ExtrinsicSubscriptionEnginePtr | ext_sub_engine, | ||
std::shared_ptr< subscription::ExtrinsicEventKeyRepository > | extrinsic_event_key_repo, | ||
std::shared_ptr< blockchain::BlockTree > | block_tree, | ||
std::shared_ptr< storage::trie::TrieStorage > | trie_storage, | ||
std::shared_ptr< runtime::Core > | core | ||
) |
context | - reference to the io context |
listener | - a shared ptr to the endpoint listener instance |
processors | - shared ptrs to JSON processor instances |
Definition at line 119 of file api_service_impl.cpp.
|
overridedefault |
|
private |
TODO(iceseer): PRE-475 make event notification depending in packs blocks, to batch them in a single message Because of a spec, we can send an array of changes in a single message. We can receive here a pack of events and format them in a single json message.
Definition at line 166 of file api_service_impl.cpp.
|
inlineprivate |
Definition at line 185 of file api_service_impl.hpp.
|
private |
Definition at line 533 of file api_service_impl.cpp.
|
private |
Definition at line 561 of file api_service_impl.cpp.
|
private |
Definition at line 516 of file api_service_impl.cpp.
|
private |
Unique ptr object to autorelease sessions. 0xff if a random not null value to jump internal nullptr check.
Definition at line 474 of file api_service_impl.cpp.
|
private |
Definition at line 520 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 193 of file api_service_impl.cpp.
|
private |
Definition at line 262 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 231 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 237 of file api_service_impl.cpp.
|
private |
Definition at line 243 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 316 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 439 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 360 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 401 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 268 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 349 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 453 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 390 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 428 of file api_service_impl.cpp.
|
overridevirtual |
Implements kagome::api::ApiService.
Definition at line 463 of file api_service_impl.cpp.
|
inlineprivate |
Definition at line 228 of file api_service_impl.hpp.
|
inlineprivate |
Definition at line 235 of file api_service_impl.hpp.
|
inlineprivate |
Definition at line 217 of file api_service_impl.hpp.
|
private |
Definition at line 246 of file api_service_impl.hpp.
|
private |
Definition at line 248 of file api_service_impl.hpp.
|
private |
Definition at line 261 of file api_service_impl.hpp.
Definition at line 243 of file api_service_impl.hpp.
|
private |
Definition at line 245 of file api_service_impl.hpp.
|
private |
Definition at line 244 of file api_service_impl.hpp.
|
private |
Definition at line 253 of file api_service_impl.hpp.
|
private |
Definition at line 250 of file api_service_impl.hpp.
struct { ... } kagome::api::ApiServiceImpl::subscription_engines_ |
|
private |
Definition at line 242 of file api_service_impl.hpp.
|
private |
Definition at line 247 of file api_service_impl.hpp.