Trait sc_rpc::system::SystemApi [−][src]
Substrate system RPC API
Required methods
pub fn system_name(&self) -> Result<String, Error>
[src]
Get the node’s implementation name. Plain old string.
pub fn system_version(&self) -> Result<String, Error>
[src]
Get the node implementation’s version. Should be a semver string.
pub fn system_chain(&self) -> Result<String, Error>
[src]
Get the chain’s name. Given as a string identifier.
pub fn system_type(&self) -> Result<ChainType, Error>
[src]
Get the chain’s type.
pub fn system_properties(&self) -> Result<Map<String, Value>, Error>
[src]
Get a custom set of properties as a JSON object, defined in the chain spec.
pub fn system_health(&self) -> Receiver<Health>
[src]
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
pub fn system_local_peer_id(&self) -> Receiver<String>
[src]
Returns the base58-encoded PeerId of the node.
pub fn system_local_listen_addresses(&self) -> Receiver<Vec<String, Global>>
[src]
Returns the multiaddresses 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 system_addReservedPeer
or as a bootnode address for example.
pub fn system_peers(
&self
) -> Compat<Pin<Box<dyn Future<Output = Result<Vec<PeerInfo<Hash, Number>, Global>, Error>> + 'static + Send, Global>>>
[src]
&self
) -> Compat<Pin<Box<dyn Future<Output = Result<Vec<PeerInfo<Hash, Number>, Global>, Error>> + 'static + Send, Global>>>
Returns currently connected peers
pub fn system_network_state(
&self
) -> Compat<Pin<Box<dyn Future<Output = Result<Value, Error>> + 'static + Send, Global>>>
[src]
&self
) -> Compat<Pin<Box<dyn Future<Output = Result<Value, Error>> + 'static + Send, Global>>>
Returns current state of the network.
Warning: This API is not stable.
pub fn system_add_reserved_peer(
&self,
peer: String
) -> Compat<Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send, Global>>>
[src]
&self,
peer: String
) -> Compat<Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send, Global>>>
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.
pub fn system_remove_reserved_peer(
&self,
peer_id: String
) -> Compat<Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send, Global>>>
[src]
&self,
peer_id: String
) -> Compat<Pin<Box<dyn Future<Output = Result<(), Error>> + 'static + Send, Global>>>
Remove a reserved peer. Returns the empty string or an error. The string
should encode only the PeerId e.g. QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV
.
pub fn system_node_roles(&self) -> Receiver<Vec<NodeRole, Global>>
[src]
Returns the roles the node is running as.
Provided methods
pub fn to_delegate<M>(self) -> IoDelegate<Self, M> where
Hash: Send + Sync + 'static + Serialize,
Number: Send + Sync + 'static + Serialize,
M: Metadata,
[src]
Hash: Send + Sync + 'static + Serialize,
Number: Send + Sync + 'static + Serialize,
M: Metadata,
Create an IoDelegate
, wiring rpc calls to the trait methods.
Implementors
impl<B: Block> SystemApi<<B as Block>::Hash, <<B as Block>::Header as Header>::Number> for System<B>
[src]
fn system_name(&self) -> Result<String>
[src]
fn system_version(&self) -> Result<String>
[src]
fn system_chain(&self) -> Result<String>
[src]
fn system_type(&self) -> Result<ChainType>
[src]
fn system_properties(&self) -> Result<Properties>
[src]
fn system_health(&self) -> Receiver<Health>
[src]
fn system_local_peer_id(&self) -> Receiver<String>
[src]
fn system_local_listen_addresses(&self) -> Receiver<Vec<String>>
[src]
fn system_peers(
&self
) -> Compat<BoxFuture<'static, Result<Vec<PeerInfo<B::Hash, <B::Header as HeaderT>::Number>>>>>
[src]
&self
) -> Compat<BoxFuture<'static, Result<Vec<PeerInfo<B::Hash, <B::Header as HeaderT>::Number>>>>>
fn system_network_state(&self) -> Compat<BoxFuture<'static, Result<Value>>>
[src]
fn system_add_reserved_peer(
&self,
peer: String
) -> Compat<BoxFuture<'static, Result<(), Error>>>
[src]
&self,
peer: String
) -> Compat<BoxFuture<'static, Result<(), Error>>>
fn system_remove_reserved_peer(
&self,
peer: String
) -> Compat<BoxFuture<'static, Result<(), Error>>>
[src]
&self,
peer: String
) -> Compat<BoxFuture<'static, Result<(), Error>>>