Trait forge::Node

source ·
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§

source

fn peer_id(&self) -> PeerId

Return the PeerId of this Node

source

fn name(&self) -> &str

Return the human readable name of this Node

source

fn version(&self) -> Version

Return the version this node is running

source

fn json_rpc_endpoint(&self) -> Url

Return the URL for the JSON-RPC endpoint of this Node

source

fn debug_endpoint(&self) -> Url

Return the URL for the debug-interface for this Node

source

fn config(&self) -> &NodeConfig

Return a reference to the Config this Node is using

source

fn start(&mut self) -> Result<()>

Start this Node. This should be a noop if the Node is already running.

source

fn stop(&mut self) -> Result<()>

Stop this Node. This should be a noop if the Node isn’t running.

source

fn clear_storage(&mut self) -> Result<()>

Clears this Node’s Storage

source

fn health_check(&mut self) -> Result<(), HealthCheckError>

Performs a Health Check on the Node

Implementors§