Kagome
Polkadot Runtime Engine in C++17
state_jrpc_processor.cpp
Go to the documentation of this file.
1 
7 
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>
31 
33  server_->registerHandler("state_call", Handler<request::Call>(api_));
34 
35  server_->registerHandler("state_getKeysPaged",
37 
38  server_->registerHandler("state_getStorage",
40 
41  // duplicate of `state_getStorage`. Required for compatibility with
42  // some client
43  server_->registerHandler("state_getStorageAt",
45 
46  server_->registerHandler("state_queryStorage",
48  server_->registerHandler("state_queryStorageAt",
50 
51  server_->registerHandler("state_getRuntimeVersion",
53 
54  // duplicate of `state_getRuntimeVersion`. Required for compatibility with
55  // some client libraries
56  server_->registerHandler("chain_getRuntimeVersion",
58 
59  server_->registerHandler("state_subscribeRuntimeVersion",
61 
62  server_->registerHandler("state_subscribeStorage",
64 
65  server_->registerHandler("state_unsubscribeStorage",
67 
68  server_->registerHandler("state_unsubscribeRuntimeVersion",
70 
71  server_->registerHandler("state_getMetadata",
73  }
74 
75 } // namespace kagome::api::state
StateJrpcProcessor(std::shared_ptr< JRpcServer > server, std::shared_ptr< StateApi > api)
void registerHandlers() override
registers callbacks for jrpc request