fn initialize_validator_config(&self, index: usize) -> NodeConfig {
        let local_ns = index.to_string() + OPERATOR_NS;
        let remote_ns = index.to_string() + OPERATOR_SHARED_NS;

        let mut config = self.template.clone_for_template();
        config.randomize_ports();

        let validator_network = config.validator_network.as_mut().unwrap();
        let validator_network_address = validator_network.listen_address.clone();
        let fullnode_network = &mut config.full_node_networks[0];
        let fullnode_network_address = fullnode_network.listen_address.clone();

        self.storage_helper
            .validator_config(
                &(index.to_string() + OWNER_SHARED_NS),
                validator_network_address,
                fullnode_network_address,
                self.template.base.chain_id,
                &local_ns,
                &remote_ns,
            )
            .unwrap();

        validator_network.identity = Identity::from_storage(
            libra_global_constants::VALIDATOR_NETWORK_KEY.into(),
            libra_global_constants::OWNER_ACCOUNT.into(),
            self.secure_backend(&local_ns, "validator"),
        );
        fullnode_network.identity = Identity::from_storage(
            libra_global_constants::FULLNODE_NETWORK_KEY.into(),
            libra_global_constants::OWNER_ACCOUNT.into(),
            self.secure_backend(&local_ns, "full_node"),
        );

        config
    }
/// Operators upload their validator_config to shared storage.
Operators upload their validator_config to shared storage.
Operators upload their validator_config to shared storage .
fn initialize_validator_config(&self, index: usize) -> NodeConfig {
        let local_ns = index.to_string() + OPERATOR_NS;
        let remote_ns = index.to_string() + OPERATOR_SHARED_NS;
        let mut config = self.template.clone_for_template();
        config.randomize_ports();
        let validator_network = config.validator_network.as_mut().unwrap();
        let validator_network_address = validator_network.listen_address.clone();
        let fullnode_network = &mut config.full_node_networks[0];
        let fullnode_network_address = fullnode_network.listen_address.clone();
        self.storage_helper
            .validator_config(
                &(index.to_string() + OWNER_SHARED_NS),
                validator_network_address,
                fullnode_network_address,
                self.template.base.chain_id,
                &local_ns,
                &remote_ns,
            )
            .unwrap();
        validator_network.identity = Identity::from_storage(
            libra_global_constants::VALIDATOR_NETWORK_KEY.into(),
            libra_global_constants::OWNER_ACCOUNT.into(),
            self.secure_backend(&local_ns, "validator"),
        );
        fullnode_network.identity = Identity::from_storage(
            libra_global_constants::FULLNODE_NETWORK_KEY.into(),
            libra_global_constants::OWNER_ACCOUNT.into(),
            self.secure_backend(&local_ns, "full_node"),
        );
        config
    }
fn initialize_validator_config ( & self , index : usize ) -> NodeConfig { let local_ns = index . to_string ( ) + OPERATOR_NS ; let remote_ns = index . to_string ( ) + OPERATOR_SHARED_NS ; let mut config = self . template . clone_for_template ( ) ; config . randomize_ports ( ) ; let validator_network = config . validator_network . as_mut ( ) . unwrap ( ) ; let validator_network_address = validator_network . listen_address . clone ( ) ; let fullnode_network = & mut config . full_node_networks [ 0 ] ; let fullnode_network_address = fullnode_network . listen_address . clone ( ) ; self . storage_helper . validator_config ( & ( index . to_string ( ) + OWNER_SHARED_NS ) , validator_network_address , fullnode_network_address , self . template . base . chain_id , & local_ns , & remote_ns , ) . unwrap ( ) ; validator_network . identity = Identity :: from_storage ( libra_global_constants :: VALIDATOR_NETWORK_KEY . into ( ) , libra_global_constants :: OWNER_ACCOUNT . into ( ) , self . secure_backend ( & local_ns , " " ) , ) ; fullnode_network . identity = Identity :: from_storage ( libra_global_constants :: FULLNODE_NETWORK_KEY . into ( ) , libra_global_constants :: OWNER_ACCOUNT . into ( ) , self . secure_backend ( & local_ns , " " ) , ) ; config }
Operators upload their validator_config to shared storage.
Operators upload their validator_config to shared storage .
&self
index
usize
&self
index
usize