I know that some RPC query exist to get informations like : system_properties system_chain system_chainType
But I would like to have all of them in a same custom call. How I can access to those informations ?
Thank you.
I know that some RPC query exist to get informations like : system_properties system_chain system_chainType
But I would like to have all of them in a same custom call. How I can access to those informations ?
Thank you.
All of those RPCs can be found here: https://github.com/paritytech/substrate/blob/master/client/rpc/src/system/mod.rs
impl<B: traits::Block> SystemApi<B::Hash, <B::Header as HeaderT>::Number> for System<B> {
// -- snip --
fn system_properties(&self) -> Result<sc_chain_spec::Properties> {
Ok(self.info.properties.clone())
}
// -- snip --
fn system_sync_state(&self) -> Receiver<SyncState<<B::Header as HeaderT>::Number>> {
let (tx, rx) = oneshot::channel();
let _ = self.send_back.unbounded_send(Request::SyncState(tx));
Receiver(rx)
}
// -- snip --
}
These are then implemented in the node's RPC configuration:
https://github.com/paritytech/substrate/blob/master/bin/node/rpc/src/lib.rs
io.extend_with(SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe)));
pub fn new( info: SystemInfo, send_back: TracingUnboundedSender<Request<B>>, deny_unsafe: DenyUnsafe, ) -> Self { System { info, send_back, deny_unsafe } }
and we pass client.clone()
for info in FullSystem::new(client.clone()