mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 23:18:01 +00:00
Add new RPC method to get the chain type (#5576)
* Add new RPC method to get the chain type This adds a new RPC method to get the chain type of the running chain. The chain type needs to be specified in the chain spec. This should make it easier for tools/UI to display extra information without needing to rely on parsing the chain name. * Update client/rpc-api/src/system/mod.rs Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Primitive crate * Feedback Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
@@ -25,7 +25,7 @@ use futures::{future::BoxFuture, compat::Compat};
|
||||
|
||||
use self::error::Result as SystemResult;
|
||||
|
||||
pub use self::helpers::{Properties, SystemInfo, Health, PeerInfo, NodeRole};
|
||||
pub use self::helpers::{SystemInfo, Health, PeerInfo, NodeRole};
|
||||
pub use self::gen_client::Client as SystemClient;
|
||||
|
||||
/// Substrate system RPC API
|
||||
@@ -39,13 +39,17 @@ pub trait SystemApi<Hash, Number> {
|
||||
#[rpc(name = "system_version")]
|
||||
fn system_version(&self) -> SystemResult<String>;
|
||||
|
||||
/// Get the chain's type. Given as a string identifier.
|
||||
/// Get the chain's name. Given as a string identifier.
|
||||
#[rpc(name = "system_chain")]
|
||||
fn system_chain(&self) -> SystemResult<String>;
|
||||
|
||||
/// Get the chain's type.
|
||||
#[rpc(name = "system_chainType")]
|
||||
fn system_type(&self) -> SystemResult<sp_chain_spec::ChainType>;
|
||||
|
||||
/// Get a custom set of properties as a JSON object, defined in the chain spec.
|
||||
#[rpc(name = "system_properties")]
|
||||
fn system_properties(&self) -> SystemResult<Properties>;
|
||||
fn system_properties(&self) -> SystemResult<sp_chain_spec::Properties>;
|
||||
|
||||
/// Return health status of the node.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user