/// Creates a set of validators with the given `image_tag`
Creates a set of validators with the given `image_tag`
Creates a set of validators with the given ` image_tag `
pub async fn spawn_validator_set(
        &self,
        num_validators: u32,
        num_fullnodes_per_validator: u32,
        enable_lsr: bool,
        lsr_backend: &str,
        image_tag: &str,
        config_overrides: &[String],
        delete_data: bool,
    ) -> Result<(Vec<Instance>, Vec<Instance>, Vec<Instance>)> {
        let mut lsrs = vec![];
        let mut vaults = vec![];
        if enable_lsr {
            if lsr_backend == "vault" {
                let mut vault_instances: Vec<_> = (0..num_validators)
                    .map(|i| {
                        let vault_config = VaultConfig {};
                        self.cluster_swarm.spawn_new_instance(
                            InstanceConfig {
                                validator_group: ValidatorGroup::new_for_index(i),
                                application_config: Vault(vault_config),
                            },
                            delete_data,
                        )
                    })
                    .collect();
                lsrs.append(&mut vault_instances);
            }
            let mut lsr_instances: Vec<_> = (0..num_validators)
                .map(|i| {
                    let lsr_config = LSRConfig {
                        num_validators,
                        image_tag: image_tag.to_string(),
                        lsr_backend: lsr_backend.to_string(),
                    };
                    self.cluster_swarm.spawn_new_instance(
                        InstanceConfig {
                            validator_group: ValidatorGroup::new_for_index(i),
                            application_config: LSR(lsr_config),
                        },
                        delete_data,
                    )
                })
                .collect();
            vaults.append(&mut lsr_instances);
        }
        let validators = (0..num_validators).map(|i| {
            let validator_config = ValidatorConfig {
                num_validators,
                num_fullnodes: num_fullnodes_per_validator,
                enable_lsr,
                image_tag: image_tag.to_string(),
                config_overrides: config_overrides.to_vec(),
            };
            self.cluster_swarm.spawn_new_instance(
                InstanceConfig {
                    validator_group: ValidatorGroup::new_for_index(i),
                    application_config: Validator(validator_config),
                },
                delete_data,
            )
        });
        let lsrs = try_join_all(lsrs).await?;
        let vaults = try_join_all(vaults).await?;
        let validators = try_join_all(validators).await?;
        Ok((validators, lsrs, vaults))
    }
pub async fn spawn_validator_set ( & self , num_validators : u32 , num_fullnodes_per_validator : u32 , enable_lsr : bool , lsr_backend : & str , image_tag : & str , config_overrides : & [ String ] , delete_data : bool , ) -> Result < ( Vec < Instance > , Vec < Instance > , Vec < Instance > ) > { let mut lsrs = vec ! [ ] ; let mut vaults = vec ! [ ] ; if enable_lsr { if lsr_backend == " " { let mut vault_instances : Vec < _ > = ( 0 .. num_validators ) . map ( | i | { let vault_config = VaultConfig { } ; self . cluster_swarm . spawn_new_instance ( InstanceConfig { validator_group : ValidatorGroup :: new_for_index ( i ) , application_config : Vault ( vault_config ) , } , delete_data , ) } ) . collect ( ) ; lsrs . append ( & mut vault_instances ) ; } let mut lsr_instances : Vec < _ > = ( 0 .. num_validators ) . map ( | i | { let lsr_config = LSRConfig { num_validators , image_tag : image_tag . to_string ( ) , lsr_backend : lsr_backend . to_string ( ) , } ; self . cluster_swarm . spawn_new_instance ( InstanceConfig { validator_group : ValidatorGroup :: new_for_index ( i ) , application_config : LSR ( lsr_config ) , } , delete_data , ) } ) . collect ( ) ; vaults . append ( & mut lsr_instances ) ; } let validators = ( 0 .. num_validators ) . map ( | i | { let validator_config = ValidatorConfig { num_validators , num_fullnodes : num_fullnodes_per_validator , enable_lsr , image_tag : image_tag . to_string ( ) , config_overrides : config_overrides . to_vec ( ) , } ; self . cluster_swarm . spawn_new_instance ( InstanceConfig { validator_group : ValidatorGroup :: new_for_index ( i ) , application_config : Validator ( validator_config ) , } , delete_data , ) } ) ; let lsrs = try_join_all ( lsrs ) . await ? ; let vaults = try_join_all ( vaults ) . await ? ; let validators = try_join_all ( validators ) . await ? ; Ok ( ( validators , lsrs , vaults ) ) }
Creates a set of validators with the given `image_tag`
Creates a set of validators with the given ` image_tag `
&self
num_validators
u32
num_fullnodes_per_validator
u32
enable_lsr
bool
lsr_backend
&str
image_tag
&str
config_overrides
&[String]
delete_data
bool