From 38b6182fb84e6f0c4ad92240b8f4562254224847 Mon Sep 17 00:00:00 2001
From: Pierre Krieger <pierre.krieger1708@gmail.com>
Date: Tue, 2 Feb 2021 15:58:29 +0100
Subject: [PATCH] Rename system_networkState to system_unstable_networkState
 (#8001)

---
 substrate/bin/node/cli/browser-demo/index.html | 4 ++--
 substrate/client/rpc-api/src/system/mod.rs     | 8 +++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/substrate/bin/node/cli/browser-demo/index.html b/substrate/bin/node/cli/browser-demo/index.html
index 60acfde39f5..4a706906ab1 100644
--- a/substrate/bin/node/cli/browser-demo/index.html
+++ b/substrate/bin/node/cli/browser-demo/index.html
@@ -27,8 +27,8 @@ async function start() {
 
 	setInterval(() => {
 		client
-			.rpcSend('{"method":"system_networkState","params":[],"id":1,"jsonrpc":"2.0"}')
-			.then((r) => log("Network state: " + r));
+			.rpcSend('{"method":"system_localPeerId","params":[],"id":1,"jsonrpc":"2.0"}')
+			.then((r) => log("Local PeerId: " + r));
 	}, 20000);
 }
 
diff --git a/substrate/client/rpc-api/src/system/mod.rs b/substrate/client/rpc-api/src/system/mod.rs
index 2cf22b98029..2e8a7aa1263 100644
--- a/substrate/client/rpc-api/src/system/mod.rs
+++ b/substrate/client/rpc-api/src/system/mod.rs
@@ -79,9 +79,11 @@ pub trait SystemApi<Hash, Number> {
 
 	/// Returns current state of the network.
 	///
-	/// **Warning**: This API is not stable.
-	// TODO: make this stable and move structs https://github.com/paritytech/substrate/issues/1890
-	#[rpc(name = "system_networkState", returns = "jsonrpc_core::Value")]
+	/// **Warning**: This API is not stable. Please do not programmatically interpret its output,
+	/// as its format might change at any time.
+	// TODO: the future of this call is uncertain: https://github.com/paritytech/substrate/issues/1890
+	// https://github.com/paritytech/substrate/issues/5541
+	#[rpc(name = "system_unstable_networkState", returns = "jsonrpc_core::Value")]
 	fn system_network_state(&self)
 		-> Compat<BoxFuture<'static, jsonrpc_core::Result<jsonrpc_core::Value>>>;
 
-- 
GitLab