Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
state_jrpc_processor.cpp
Go to the documentation of this file.
1
6
#include "
api/service/state/state_jrpc_processor.hpp
"
7
8
#include "
api/jrpc/jrpc_method.hpp
"
9
#include "
api/service/state/requests/call.hpp
"
10
#include "
api/service/state/requests/get_keys_paged.hpp
"
11
#include "
api/service/state/requests/get_metadata.hpp
"
12
#include "
api/service/state/requests/get_runtime_version.hpp
"
13
#include "
api/service/state/requests/get_storage.hpp
"
14
#include "
api/service/state/requests/query_storage.hpp
"
15
#include "
api/service/state/requests/subscribe_runtime_version.hpp
"
16
#include "
api/service/state/requests/subscribe_storage.hpp
"
17
#include "
api/service/state/requests/unsubscribe_runtime_version.hpp
"
18
#include "
api/service/state/requests/unsubscribe_storage.hpp
"
19
20
namespace
kagome::api::state
{
21
22
StateJrpcProcessor::StateJrpcProcessor
(std::shared_ptr<JRpcServer> server,
23
std::shared_ptr<StateApi> api)
24
: api_{std::move(api)},
server_
{std::move(server)} {
25
BOOST_ASSERT(
api_
!=
nullptr
);
26
BOOST_ASSERT(
server_
!=
nullptr
);
27
}
28
29
template
<
typename
Request>
30
using
Handler
=
kagome::api::Method<Request, StateApi>
;
31
32
void
StateJrpcProcessor::registerHandlers
() {
33
server_
->registerHandler(
"state_call"
,
Handler<request::Call>
(
api_
));
34
35
server_
->registerHandler(
"state_getKeysPaged"
,
36
Handler<request::GetKeysPaged>
(
api_
));
37
38
server_
->registerHandler(
"state_getStorage"
,
39
Handler<request::GetStorage>
(
api_
));
40
41
// duplicate of `state_getStorage`. Required for compatibility with
42
// some client
43
server_
->registerHandler(
"state_getStorageAt"
,
44
Handler<request::GetStorage>
(
api_
));
45
46
server_
->registerHandler(
"state_queryStorage"
,
47
Handler<request::QueryStorage>
(
api_
));
48
server_
->registerHandler(
"state_queryStorageAt"
,
49
Handler<request::QueryStorageAt>
(
api_
));
50
51
server_
->registerHandler(
"state_getRuntimeVersion"
,
52
Handler<request::GetRuntimeVersion>
(
api_
));
53
54
// duplicate of `state_getRuntimeVersion`. Required for compatibility with
55
// some client libraries
56
server_
->registerHandler(
"chain_getRuntimeVersion"
,
57
Handler<request::GetRuntimeVersion>
(
api_
));
58
59
server_
->registerHandler(
"state_subscribeRuntimeVersion"
,
60
Handler<request::SubscribeRuntimeVersion>
(
api_
));
61
62
server_
->registerHandler(
"state_subscribeStorage"
,
63
Handler<request::SubscribeStorage>
(
api_
));
64
65
server_
->registerHandler(
"state_unsubscribeStorage"
,
66
Handler<request::UnsubscribeStorage>
(
api_
));
67
68
server_
->registerHandler(
"state_unsubscribeRuntimeVersion"
,
69
Handler<request::UnsubscribeRuntimeVersion>
(
api_
));
70
71
server_
->registerHandler(
"state_getMetadata"
,
72
Handler<request::GetMetadata>
(
api_
));
73
}
74
75
}
// namespace kagome::api::state
query_storage.hpp
kagome::api::state::StateJrpcProcessor::api_
std::shared_ptr< StateApi > api_
Definition:
state_jrpc_processor.hpp:25
state_jrpc_processor.hpp
kagome::api::state::StateJrpcProcessor::StateJrpcProcessor
StateJrpcProcessor(std::shared_ptr< JRpcServer > server, std::shared_ptr< StateApi > api)
Definition:
state_jrpc_processor.cpp:22
subscribe_storage.hpp
kagome::api::state::StateJrpcProcessor::registerHandlers
void registerHandlers() override
registers callbacks for jrpc request
Definition:
state_jrpc_processor.cpp:32
get_metadata.hpp
unsubscribe_runtime_version.hpp
kagome::api::Method
Definition:
jrpc_method.hpp:20
unsubscribe_storage.hpp
jrpc_method.hpp
kagome::api::state
get_storage.hpp
get_keys_paged.hpp
kagome::api::state::StateJrpcProcessor::server_
std::shared_ptr< JRpcServer > server_
Definition:
state_jrpc_processor.hpp:26
subscribe_runtime_version.hpp
get_runtime_version.hpp
call.hpp
core
api
service
state
state_jrpc_processor.cpp
Generated by
1.8.11