mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +00:00
Allow to expose a subset of unsafe RPCs (#5233)
* sc-cli: Use type-safe constructors for RPC/Prometheus interfaces * service: Simplify rpc handler creation Could probably be further simplifies once [this][commit] lands. [commit]: https://github.com/paritytech/jsonrpc/commit/20485387ed06a48f1a70bf4d609a7cde6cf0accf * service: Streamline some HTTP & WS server start logic * client: Introduce a simple RPC policy mechanism * rpc/system: Check unsafe RPCs * rpc/offchain: Check unsafe RPCs * rpc/author: Check unsafe RPCs
This commit is contained in:
@@ -72,14 +72,16 @@ pub trait SystemApi<Hash, Number> {
|
||||
|
||||
/// Returns currently connected peers
|
||||
#[rpc(name = "system_peers", returns = "Vec<PeerInfo<Hash, Number>>")]
|
||||
fn system_peers(&self) -> Receiver<Vec<PeerInfo<Hash, Number>>>;
|
||||
fn system_peers(&self)
|
||||
-> Compat<BoxFuture<'static, jsonrpc_core::Result<Vec<PeerInfo<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")]
|
||||
fn system_network_state(&self) -> Receiver<jsonrpc_core::Value>;
|
||||
fn system_network_state(&self)
|
||||
-> Compat<BoxFuture<'static, jsonrpc_core::Result<jsonrpc_core::Value>>>;
|
||||
|
||||
/// Adds a reserved peer. Returns the empty string or an error. The string
|
||||
/// parameter should encode a `p2p` multiaddr.
|
||||
|
||||
Reference in New Issue
Block a user