From ce84efb00f8f0005e2e239df07354439cd1f95cb Mon Sep 17 00:00:00 2001 From: Alexander Krupenkin Date: Fri, 28 Jan 2022 12:54:46 +0300 Subject: [PATCH] Enable full RPC for parachain --- bin/node/service/src/parachain/service.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/bin/node/service/src/parachain/service.rs b/bin/node/service/src/parachain/service.rs index 1ab1e7b28..3be5dd9bb 100644 --- a/bin/node/service/src/parachain/service.rs +++ b/bin/node/service/src/parachain/service.rs @@ -46,7 +46,6 @@ use sp_runtime::traits::BlakeTwo256; use sp_trie::PrefixedMemoryDB; use std::sync::Arc; use std::time::Duration; -use substrate_frame_rpc_system::{FullSystem, SystemApi}; use substrate_prometheus_endpoint::Registry; fn new_partial( @@ -276,15 +275,14 @@ where sc_service::spawn_tasks(sc_service::SpawnTasksParams { rpc_extensions_builder: Box::new(move |deny_unsafe, _| { - let mut io = jsonrpc_core::IoHandler::default(); - io.extend_with(SystemApi::to_delegate(FullSystem::new( - rpc_client.clone(), - rpc_pool.clone(), + let deps = robonomics_rpc::FullDeps { + client: rpc_client.clone(), + pool: rpc_pool.clone(), deny_unsafe, - ))); - io.extend_with(PubSubApi::to_delegate(PubSubApi::new(pubsub.clone()))); - io.extend_with(ReqRespApi::to_delegate(ReqRespApi {})); - Ok(io) + pubsub: pubsub.clone(), + }; + + robonomics_rpc::create_full(deps).map_err(Into::into) }), client: client.clone(), transaction_pool: transaction_pool.clone(),