pub fn add_chain_config(&mut self, config: &PortalChainConfig) {
        // Replace if config with the same network key already exists
        if let Some(index) = self
            .hyperchains_config
            .iter()
            .position(|c| c.network.key == config.network.key)
        {
            self.hyperchains_config[index] = config.clone();
            return;
        }
        self.hyperchains_config.push(config.clone());
    }
Adds or updates a given chain configuration.
zkstack_cli/crates/config/src/portal.rs