pub trait Node {
// Required methods
fn peer_id(&self) -> PeerId;
fn name(&self) -> &str;
fn version(&self) -> Version;
fn json_rpc_endpoint(&self) -> Url;
fn debug_endpoint(&self) -> Url;
fn config(&self) -> &NodeConfig;
fn start(&mut self) -> Result<()>;
fn stop(&mut self) -> Result<()>;
fn clear_storage(&mut self) -> Result<()>;
fn health_check(&mut self) -> Result<(), HealthCheckError>;
}
Expand description
Trait used to represent a running Validator or FullNode
Required Methods§
sourcefn json_rpc_endpoint(&self) -> Url
fn json_rpc_endpoint(&self) -> Url
Return the URL for the JSON-RPC endpoint of this Node
sourcefn debug_endpoint(&self) -> Url
fn debug_endpoint(&self) -> Url
Return the URL for the debug-interface for this Node
sourcefn config(&self) -> &NodeConfig
fn config(&self) -> &NodeConfig
Return a reference to the Config this Node is using
sourcefn start(&mut self) -> Result<()>
fn start(&mut self) -> Result<()>
Start this Node. This should be a noop if the Node is already running.
sourcefn stop(&mut self) -> Result<()>
fn stop(&mut self) -> Result<()>
Stop this Node. This should be a noop if the Node isn’t running.
sourcefn clear_storage(&mut self) -> Result<()>
fn clear_storage(&mut self) -> Result<()>
Clears this Node’s Storage
sourcefn health_check(&mut self) -> Result<(), HealthCheckError>
fn health_check(&mut self) -> Result<(), HealthCheckError>
Performs a Health Check on the Node