pub fn load<P: AsRef<Path>>(mut peer_id: Option<String>, path: P) -> Result<Self> {
        let mut config = Self::load_config(&path);
        let mut validator_count = 0;
        for network in &mut config.networks {
            // We use provided peer id for validator role. Otherwise peer id is generated using
            // network identity key.
            if network.role == "validator" {
                assert_eq!(
                    validator_count, 0,
                    "At most 1 network config should be for a validator"
                );
                assert!(peer_id.is_some());
                network.load(peer_id.take(), path.as_ref())?;
                validator_count += 1;
            } else {
                network.load(None, path.as_ref())?;
            }
        }
        config.consensus.load(path.as_ref())?;
        NodeConfigHelpers::update_data_dir_path_if_needed(&mut config, &path)?;
        Ok(config)
    }
/// Reads the config file and returns the configuration object in addition to doing some
/// post-processing of the config
/// Paths used in the config are either absolute or relative to the config location
Reads the config file and returns the configuration object in addition to doing some
post-processing of the config
Paths used in the config are either absolute or relative to the config location
Reads the config file and returns the configuration object in addition to doing some post - processing of the config Paths used in the config are either absolute or relative to the config location
pub fn load<P: AsRef<Path>>(mut peer_id: Option<String>, path: P) -> Result<Self> {
        let mut config = Self::load_config(&path);
        let mut validator_count = 0;
        for network in &mut config.networks {
            // We use provided peer id for validator role. Otherwise peer id is generated using
            // network identity key.
            if network.role == "validator" {
                assert_eq!(
                    validator_count, 0,
                    "At most 1 network config should be for a validator"
                );
                assert!(peer_id.is_some());
                network.load(peer_id.take(), path.as_ref())?;
                validator_count += 1;
            } else {
                network.load(None, path.as_ref())?;
            }
        }
        config.consensus.load(path.as_ref())?;
        NodeConfigHelpers::update_data_dir_path_if_needed(&mut config, &path)?;
        Ok(config)
    }
pub fn load < P : AsRef < Path > > ( mut peer_id : Option < String > , path : P ) -> Result < Self > { let mut config = Self :: load_config ( & path ) ; let mut validator_count = 0 ; for network in & mut config . networks { // We use provided peer id for validator role. Otherwise peer id is generated using // network identity key. if network . role == " " { assert_eq ! ( validator_count 0 " " ) ; assert ! ( peer_id is_some ( ) ) ; network . load ( peer_id . take ( ) , path . as_ref ( ) ) ? ; validator_count += 1 ; } else { network . load ( None , path . as_ref ( ) ) ? ; } } config . consensus . load ( path . as_ref ( ) ) ? ; NodeConfigHelpers :: update_data_dir_path_if_needed ( & mut config , & path ) ? ; Ok ( config ) }
Reads the config file and returns the configuration object in addition to doing some
post-processing of the config
Paths used in the config are either absolute or relative to the config location
Reads the config file and returns the configuration object in addition to doing some post - processing of the config Paths used in the config are either absolute or relative to the config location
peer_id
Option<String>
path
P