@@ -453,23 +453,30 @@ impl NetworkConfiguration {
453453 Some ( file) => Some ( NetworkConfiguration :: resolve_path ( & file. path ( ) ) ?) ,
454454 } ;
455455
456- println ! ( "HELLOOOOOOO: {:?}" , relay_chain_spec_file) ;
457-
458456 // Use builder to clone network config, adapting binary paths as necessary
459457 let mut builder = NetworkConfigBuilder :: new ( )
460458 . with_relaychain ( |relay| {
461459 let source = self . 0 . relaychain ( ) ;
462460 let nodes = source. nodes ( ) ;
463461
464462 let mut builder = relay
465- . with_chain ( source. chain ( ) . as_str ( ) )
466463 . with_default_args ( source. default_args ( ) . into_iter ( ) . cloned ( ) . collect ( ) )
467464 // Replace default command with resolved binary path
468465 . with_default_command ( binary_path. as_str ( ) ) ;
469466
467+ // Configure chain spec generator or file
468+ // Note: When using chain_spec_path, we should not set the chain parameter
469+ // as the chain spec file itself contains the chain definition
470+ if let Some ( ref path) = relay_chain_spec_file {
471+ builder = builder. with_chain_spec_path ( PathBuf :: from ( path) ) ;
472+ } else if let Some ( command) = chain_spec_generator {
473+ builder = builder. with_chain_spec_command ( command) ;
474+ } else {
475+ // Only set chain parameter if not using a chain spec file
476+ builder = builder. with_chain ( source. chain ( ) . as_str ( ) ) ;
477+ }
478+
470479 // Chain spec
471- println ! ( "SOURCE chain_spec_command: {:?}" , source. chain_spec_command( ) ) ;
472- println ! ( "SOURCE chain_spec_path: {:?}" , source. chain_spec_path( ) ) ;
473480 if let Some ( command) = source. chain_spec_command ( ) {
474481 builder = builder. with_chain_spec_command ( command) ;
475482 }
@@ -485,12 +492,6 @@ impl NetworkConfiguration {
485492 builder =
486493 builder. with_chain_spec_command_output_path ( chain_spec_command_output_path) ;
487494 }
488- // Configure chain spec generator or file
489- if let Some ( ref path) = relay_chain_spec_file {
490- builder = builder. with_chain_spec_path ( PathBuf :: from ( path) ) ;
491- } else if let Some ( command) = chain_spec_generator {
492- builder = builder. with_chain_spec_command ( command) ;
493- }
494495 // Overrides: genesis/wasm
495496 if let Some ( genesis) = source. runtime_genesis_patch ( ) {
496497 builder = builder. with_genesis_overrides ( genesis. clone ( ) ) ;
0 commit comments