Trait sc_rpc::system::SystemApiClient
source · pub trait SystemApiClient<Hash, Number>: ClientTwhere
Hash: Send + Sync + 'static + DeserializeOwned,
Number: Send + Sync + 'static + DeserializeOwned,{
Show 17 methods
// Provided methods
fn system_name<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_version<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_chain<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_type<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ChainType, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_properties<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_health<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Health, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_local_peer_id<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_local_listen_addresses<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<String, Global>, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo<Hash, Number>, Global>, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_network_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_add_reserved_peer<'life0, 'async_trait>(
&'life0 self,
peer: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_remove_reserved_peer<'life0, 'async_trait>(
&'life0 self,
peer_id: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_reserved_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<String, Global>, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_node_roles<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<NodeRole, Global>, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_sync_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SyncState<Number>, Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_add_log_filter<'life0, 'async_trait>(
&'life0 self,
directives: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn system_reset_log_filter<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
}
Expand description
Client implementation for the SystemApi
RPC API.
Provided Methods§
sourcefn system_name<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_name<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Get the node’s implementation name. Plain old string.
sourcefn system_version<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Get the node implementation’s version. Should be a semver string.
sourcefn system_chain<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_chain<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Get the chain’s name. Given as a string identifier.
sourcefn system_type<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ChainType, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_type<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<ChainType, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Get the chain’s type.
sourcefn system_properties<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_properties<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Get a custom set of properties as a JSON object, defined in the chain spec.
sourcefn system_health<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Health, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_health<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Health, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Return health status of the node.
Node is considered healthy if it is:
- connected to some peers (unless running in dev mode)
- not performing a major sync
sourcefn system_local_peer_id<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_local_peer_id<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Returns the base58-encoded PeerId of the node.
sourcefn system_local_listen_addresses<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<String, Global>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_local_listen_addresses<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<String, Global>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Returns the multi-addresses that the local node is listening on
The addresses include a trailing /p2p/
with the local PeerId, and are thus suitable to
be passed to addReservedPeer
or as a bootnode address for example.
sourcefn system_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo<Hash, Number>, Global>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo<Hash, Number>, Global>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Returns currently connected peers
sourcefn system_network_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_network_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Returns current state of the network.
Warning: This API is not stable. Please do not programmatically interpret its output, as its format might change at any time.
sourcefn system_add_reserved_peer<'life0, 'async_trait>(
&'life0 self,
peer: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_add_reserved_peer<'life0, 'async_trait>( &'life0 self, peer: String ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Adds a reserved peer. Returns the empty string or an error. The string
parameter should encode a p2p
multiaddr.
/ip4/198.51.100.19/tcp/30333/p2p/QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV
is an example of a valid, passing multiaddr with PeerId attached.
sourcefn system_remove_reserved_peer<'life0, 'async_trait>(
&'life0 self,
peer_id: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_remove_reserved_peer<'life0, 'async_trait>( &'life0 self, peer_id: String ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Remove a reserved peer. Returns the empty string or an error. The string
should encode only the PeerId e.g. QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV
.
sourcefn system_reserved_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<String, Global>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_reserved_peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<String, Global>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Returns the list of reserved peers
sourcefn system_node_roles<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<NodeRole, Global>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_node_roles<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<NodeRole, Global>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Returns the roles the node is running as.
sourcefn system_sync_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SyncState<Number>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_sync_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SyncState<Number>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Returns the state of the syncing of the node: starting block, current best block, highest known block.
sourcefn system_add_log_filter<'life0, 'async_trait>(
&'life0 self,
directives: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn system_add_log_filter<'life0, 'async_trait>( &'life0 self, directives: String ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Sync + 'async_trait,
Adds the supplied directives to the current log filter
The syntax is identical to the CLI <target>=<level>
:
sync=debug,state=trace