pub struct System<B: Block> { /* private fields */ }
Expand description
System API implementation
Implementations§
source§impl<B: Block> System<B>
impl<B: Block> System<B>
sourcepub fn new(
info: SystemInfo,
send_back: TracingUnboundedSender<Request<B>>,
deny_unsafe: DenyUnsafe
) -> Self
pub fn new( info: SystemInfo, send_back: TracingUnboundedSender<Request<B>>, deny_unsafe: DenyUnsafe ) -> Self
Creates new System
.
The send_back
will be used to transmit some of the requests. The user is responsible for
reading from that channel and answering the requests.
Trait Implementations§
source§impl<B: Block> SystemApiServer<<B as Block>::Hash, <<B as Block>::Header as Header>::Number> for System<B>
impl<B: Block> SystemApiServer<<B as Block>::Hash, <<B as Block>::Header as Header>::Number> for System<B>
source§fn system_name(&self) -> RpcResult<String>
fn system_name(&self) -> RpcResult<String>
Get the node’s implementation name. Plain old string.
source§fn system_version(&self) -> RpcResult<String>
fn system_version(&self) -> RpcResult<String>
Get the node implementation’s version. Should be a semver string.
source§fn system_chain(&self) -> RpcResult<String>
fn system_chain(&self) -> RpcResult<String>
Get the chain’s name. Given as a string identifier.
source§fn system_type(&self) -> RpcResult<ChainType>
fn system_type(&self) -> RpcResult<ChainType>
Get the chain’s type.
source§fn system_properties(&self) -> RpcResult<Properties>
fn system_properties(&self) -> RpcResult<Properties>
Get a custom set of properties as a JSON object, defined in the chain spec.
source§fn system_health<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = RpcResult<Health>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_health<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RpcResult<Health>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Return health status of the node. Read more
source§fn system_local_peer_id<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = RpcResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_local_peer_id<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RpcResult<String>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Returns the base58-encoded PeerId of the node.
source§fn system_local_listen_addresses<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = RpcResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_local_listen_addresses<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<String>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Returns the multi-addresses that the local node is listening on Read more
source§fn system_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = RpcResult<Vec<PeerInfo<B::Hash, <B::Header as HeaderT>::Number>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<PeerInfo<B::Hash, <B::Header as HeaderT>::Number>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Returns currently connected peers
source§fn system_network_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = RpcResult<JsonValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_network_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RpcResult<JsonValue>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Returns current state of the network. Read more
source§fn system_add_reserved_peer<'life0, 'async_trait>(
&'life0 self,
peer: String
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_add_reserved_peer<'life0, 'async_trait>( &'life0 self, peer: String ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Adds a reserved peer. Returns the empty string or an error. The string
parameter should encode a
p2p
multiaddr. Read moresource§fn system_remove_reserved_peer<'life0, 'async_trait>(
&'life0 self,
peer: String
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_remove_reserved_peer<'life0, 'async_trait>( &'life0 self, peer: String ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Remove a reserved peer. Returns the empty string or an error. The string
should encode only the PeerId e.g.
QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV
.source§fn system_reserved_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = RpcResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_reserved_peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<String>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Returns the list of reserved peers
source§fn system_node_roles<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = RpcResult<Vec<NodeRole>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_node_roles<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<NodeRole>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Returns the roles the node is running as.
source§fn system_sync_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = RpcResult<SyncState<<B::Header as HeaderT>::Number>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn system_sync_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RpcResult<SyncState<<B::Header as HeaderT>::Number>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Returns the state of the syncing of the node: starting block, current best block, highest
known block.
source§fn system_add_log_filter(&self, directives: String) -> RpcResult<()>
fn system_add_log_filter(&self, directives: String) -> RpcResult<()>
Adds the supplied directives to the current log filter Read more
source§fn system_reset_log_filter(&self) -> RpcResult<()>
fn system_reset_log_filter(&self) -> RpcResult<()>
Resets the log filter to Substrate defaults
Auto Trait Implementations§
impl<B> !RefUnwindSafe for System<B>
impl<B> Send for System<B>
impl<B> Sync for System<B>
impl<B> Unpin for System<B>
impl<B> !UnwindSafe for System<B>
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.