mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +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:
@@ -18,10 +18,7 @@
|
||||
|
||||
use std::fmt;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde_json::{Value, map::Map};
|
||||
|
||||
/// Node properties
|
||||
pub type Properties = Map<String, Value>;
|
||||
use sp_chain_spec::{Properties, ChainType};
|
||||
|
||||
/// Running node's static details.
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -34,6 +31,8 @@ pub struct SystemInfo {
|
||||
pub chain_name: String,
|
||||
/// A custom set of properties defined in the chain spec.
|
||||
pub properties: Properties,
|
||||
/// The type of this chain.
|
||||
pub chain_type: ChainType,
|
||||
}
|
||||
|
||||
/// Health struct returned by the RPC
|
||||
|
||||
Reference in New Issue
Block a user