MCPcopy Create free account
hub / github.com/DataHighway-DHX/node / create_light

Function create_light

node/src/rpc.rs:192–220  ·  view source on GitHub ↗

Instantiate all Light RPC extensions.

(deps: LightDeps<C, F, P>)

Source from the content-addressed store, hash-verified

190
191/// Instantiate all Light RPC extensions.
192pub fn create_light<C, P, M, F>(deps: LightDeps<C, F, P>) -> jsonrpc_core::IoHandler<M>
193where
194 C: sp_blockchain::HeaderBackend<Block>,
195 C: Send + Sync + 'static,
196 F: sc_client_api::light::Fetcher<Block> + 'static,
197 P: TransactionPool + 'static,
198 M: jsonrpc_core::Metadata + Default,
199{
200 use substrate_frame_rpc_system::{
201 LightSystem,
202 SystemApi,
203 };
204
205 let LightDeps {
206 client,
207 pool,
208 remote_blockchain,
209 fetcher,
210 } = deps;
211 let mut io = jsonrpc_core::IoHandler::default();
212 io.extend_with(SystemApi::<Hash, AccountId, Index>::to_delegate(LightSystem::new(
213 client,
214 remote_blockchain,
215 fetcher,
216 pool,
217 )));
218
219 io
220}

Callers 1

new_light_baseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected