Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
chain_jrpc_processor.cpp
Go to the documentation of this file.
1
6
#include "
api/service/chain/chain_jrpc_processor.hpp
"
7
8
#include "
api/jrpc/jrpc_method.hpp
"
9
#include "
api/jrpc/value_converter.hpp
"
10
#include "
api/service/chain/requests/get_block.hpp
"
11
#include "
api/service/chain/requests/get_block_hash.hpp
"
12
#include "
api/service/chain/requests/get_finalized_head.hpp
"
13
#include "
api/service/chain/requests/get_header.hpp
"
14
#include "
api/service/chain/requests/subscribe_finalized_heads.hpp
"
15
#include "
api/service/chain/requests/subscribe_new_heads.hpp
"
16
#include "
api/service/chain/requests/unsubscribe_finalized_heads.hpp
"
17
#include "
api/service/chain/requests/unsubscribe_new_heads.hpp
"
18
19
namespace
kagome::api::chain
{
20
21
ChainJrpcProcessor::ChainJrpcProcessor
(std::shared_ptr<JRpcServer> server,
22
std::shared_ptr<ChainApi> api)
23
: api_{std::move(api)},
server_
{std::move(server)} {
24
BOOST_ASSERT(
api_
!=
nullptr
);
25
BOOST_ASSERT(
server_
!=
nullptr
);
26
}
27
28
template
<
typename
Request>
29
using
Handler
=
Method<Request, ChainApi>
;
30
31
void
ChainJrpcProcessor::registerHandlers
() {
32
server_
->registerHandler(
"chain_getBlockHash"
,
33
Handler<request::GetBlockhash>
(
api_
));
34
server_
->registerHandler(
"chain_getHead"
,
35
Handler<request::GetBlockhash>
(
api_
));
36
37
server_
->registerHandler(
"chain_getHeader"
,
38
Handler<request::GetHeader>
(
api_
));
39
40
server_
->registerHandler(
"chain_getBlock"
,
41
Handler<request::GetBlock>
(
api_
));
42
43
server_
->registerHandler(
"chain_getFinalizedHead"
,
44
Handler<request::GetFinalizedHead>
(
api_
));
45
server_
->registerHandler(
"chain_getFinalisedHead"
,
46
Handler<request::GetFinalizedHead>
(
api_
));
47
48
server_
->registerHandler(
"chain_subscribeFinalizedHeads"
,
49
Handler<request::SubscribeFinalizedHeads>
(
api_
));
50
51
server_
->registerHandler(
"chain_unsubscribeFinalizedHeads"
,
52
Handler<request::UnsubscribeFinalizedHeads>
(
api_
));
53
54
server_
->registerHandler(
"chain_subscribeNewHeads"
,
55
Handler<request::SubscribeNewHeads>
(
api_
));
56
57
server_
->registerHandler(
"chain_unsubscribeNewHeads"
,
58
Handler<request::UnsubscribeNewHeads>
(
api_
));
59
60
server_
->registerHandler(
"chain_subscribeNewHead"
,
61
Handler<request::SubscribeNewHeads>
(
api_
));
62
63
server_
->registerHandler(
"chain_unsubscribeNewHead"
,
64
Handler<request::UnsubscribeNewHeads>
(
api_
));
65
}
66
67
}
// namespace kagome::api::chain
unsubscribe_finalized_heads.hpp
get_block_hash.hpp
kagome::api::chain
Definition:
chain_jrpc_processor.cpp:19
unsubscribe_new_heads.hpp
kagome::api::chain::ChainJrpcProcessor::server_
std::shared_ptr< JRpcServer > server_
Definition:
chain_jrpc_processor.hpp:25
chain_jrpc_processor.hpp
kagome::api::chain::ChainJrpcProcessor::registerHandlers
void registerHandlers() override
registers callbacks for jrpc request
Definition:
chain_jrpc_processor.cpp:31
kagome::api::chain::ChainJrpcProcessor::api_
std::shared_ptr< ChainApi > api_
Definition:
chain_jrpc_processor.hpp:24
get_header.hpp
get_block.hpp
subscribe_finalized_heads.hpp
get_finalized_head.hpp
subscribe_new_heads.hpp
value_converter.hpp
kagome::api::Method
Definition:
jrpc_method.hpp:20
kagome::api::chain::ChainJrpcProcessor::ChainJrpcProcessor
ChainJrpcProcessor(std::shared_ptr< JRpcServer > server, std::shared_ptr< ChainApi > api)
Definition:
chain_jrpc_processor.cpp:21
jrpc_method.hpp
core
api
service
chain
chain_jrpc_processor.cpp
Generated by
1.8.11