pub trait Node: Send + Sync {
fn peer_id(&self) -> PeerId;
fn name(&self) -> &str;
fn version(&self) -> Version;
fn rest_api_endpoint(&self) -> Url;
fn inspection_service_endpoint(&self) -> Url;
fn config(&self) -> &NodeConfig;
fn start<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn stop(&mut self) -> Result<()>;
fn clear_storage(&mut self) -> Result<()>;
fn health_check<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), HealthCheckError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn counter(&self, counter: &str, port: u64) -> Result<f64>;
fn expose_metric(&self) -> Result<u64>;
}Expand description
Trait used to represent a running Validator or FullNode
Required Methods
fn rest_api_endpoint(&self) -> Url
fn rest_api_endpoint(&self) -> Url
Return the URL for the REST API endpoint of this Node
fn inspection_service_endpoint(&self) -> Url
fn inspection_service_endpoint(&self) -> Url
Return the URL for the debug-interface for this Node
fn config(&self) -> &NodeConfig
fn config(&self) -> &NodeConfig
Return a reference to the Config this Node is using
Start this Node. This should be a noop if the Node is already running.
Stop this Node. This should be a noop if the Node isn’t running.
fn clear_storage(&mut self) -> Result<()>
fn clear_storage(&mut self) -> Result<()>
Clears this Node’s Storage
fn health_check<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), HealthCheckError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), HealthCheckError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Performs a Health Check on the Node