pub trait Swarm: Sync {
Show 17 methods fn health_check<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn validators<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = &'a dyn Validator> + 'a>; fn validators_mut<'a>(
        &'a mut self
    ) -> Box<dyn Iterator<Item = &'a mut dyn Validator> + 'a>; fn validator(&self, id: PeerId) -> Option<&dyn Validator>; fn validator_mut(&mut self, id: PeerId) -> Option<&mut dyn Validator>; fn upgrade_validator(&mut self, id: PeerId, version: &Version) -> Result<()>; fn full_nodes<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = &'a dyn FullNode> + 'a>; fn full_nodes_mut<'a>(
        &'a mut self
    ) -> Box<dyn Iterator<Item = &'a mut dyn FullNode> + 'a>; fn full_node(&self, id: PeerId) -> Option<&dyn FullNode>; fn full_node_mut(&mut self, id: PeerId) -> Option<&mut dyn FullNode>; fn add_validator(
        &mut self,
        version: &Version,
        template: NodeConfig
    ) -> Result<PeerId>; fn remove_validator(&mut self, id: PeerId) -> Result<()>; fn add_full_node(
        &mut self,
        version: &Version,
        template: NodeConfig
    ) -> Result<PeerId>; fn remove_full_node(&mut self, id: PeerId) -> Result<()>; fn versions<'a>(&'a self) -> Box<dyn Iterator<Item = Version> + 'a>; fn chain_info(&mut self) -> ChainInfo<'_>; fn logs_location(&mut self) -> String;
}
Expand description

Trait used to represent a running network comprised of Validators and FullNodes

Required Methods

Performs a health check on the entire swarm, ensuring all Nodes are Live and that no forks have occurred

Returns an Iterator of references to all the Validators in the Swarm

Returns an Iterator of mutable references to all the Validators in the Swarm

Returns a reference to the Validator with the provided PeerId

Returns a mutable reference to the Validator with the provided PeerId

Upgrade a Validator to run specified Version

Returns an Iterator of references to all the FullNodes in the Swarm

Returns an Iterator of mutable references to all the FullNodes in the Swarm

Returns a reference to the FullNode with the provided PeerId

Returns a mutable reference to the FullNode with the provided PeerId

Adds a Validator to the swarm with the provided PeerId

Removes the Validator with the provided PeerId

Adds a FullNode to the swarm with the provided PeerId

Removes the FullNode with the provided PeerId

Return a list of supported Versions

Construct a ChainInfo from this Swarm

Implementors