Kagome
Polkadot Runtime Engine in C++17
chain_jrpc_processor.cpp
Go to the documentation of this file.
1 
7 
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>
30 
32  server_->registerHandler("chain_getBlockHash",
34  server_->registerHandler("chain_getHead",
36 
37  server_->registerHandler("chain_getHeader",
39 
40  server_->registerHandler("chain_getBlock",
42 
43  server_->registerHandler("chain_getFinalizedHead",
45  server_->registerHandler("chain_getFinalisedHead",
47 
48  server_->registerHandler("chain_subscribeFinalizedHeads",
50 
51  server_->registerHandler("chain_unsubscribeFinalizedHeads",
53 
54  server_->registerHandler("chain_subscribeNewHeads",
56 
57  server_->registerHandler("chain_unsubscribeNewHeads",
59 
60  server_->registerHandler("chain_subscribeNewHead",
62 
63  server_->registerHandler("chain_unsubscribeNewHead",
65  }
66 
67 } // namespace kagome::api::chain
void registerHandlers() override
registers callbacks for jrpc request
ChainJrpcProcessor(std::shared_ptr< JRpcServer > server, std::shared_ptr< ChainApi > api)