Trait SystemApi

Source
pub trait SystemApi {
    type ChainType;
    type Properties;
    type Health;

    // Required methods
    fn get_system_name<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_system_version<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_system_chain<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_system_chain_type<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::ChainType>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_system_properties<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Properties>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_system_health<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Health>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_system_local_peer_id<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_system_local_listen_addresses<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Helper functions for some common SystemApi function.

Required Associated Types§

Required Methods§

Source

fn get_system_name<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the node’s implementation name.

Source

fn get_system_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the node implementation’s version. Should be a semver string.

Source

fn get_system_chain<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the chain’s name. Given as a string identifier.

Source

fn get_system_chain_type<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::ChainType>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the chain’s type.

Source

fn get_system_properties<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Properties>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a custom set of properties as a JSON object, defined in the chain spec.

Source

fn get_system_health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Health>> + 'async_trait>>
where Self: 'async_trait, 'life0: '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
Source

fn get_system_local_peer_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the base58-encoded PeerId of the node.

Source

fn get_system_local_listen_addresses<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + 'async_trait>>
where Self: 'async_trait, 'life0: '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.

Implementors§

Source§

impl<T, Client> SystemApi for Api<T, Client>
where T: Config, Client: Request,