Skip to content

Commit

Permalink
refactor: sync with axon new start commands
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyuanhust committed Sep 24, 2023
1 parent 4205215 commit 32f6766
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions tools/ibc-test/src/framework/utils/axon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ pub(crate) fn prepare_axon_chain(
// copy configs to working dir
for file in [
"config.toml",
"genesis_single_node.json",
"specs/single_node/chain-spec.toml",
"debug.key",
"default.db-options",
] {
let src_path = axon_src_path.join("devtools/chain").join(file);
Expand All @@ -61,7 +62,8 @@ pub(crate) fn prepare_axon_chain(
}

let chain_config_path = working_dir.join("config.toml");
let genesis_config_path = working_dir.join("genesis_single_node.json");
let chain_spec_path = working_dir.join("specs/single_node/chain-spec.toml");
let key_file_path = working_dir.join("debug.key");

// Modify configs

Expand Down Expand Up @@ -94,14 +96,29 @@ pub(crate) fn prepare_axon_chain(
fs::write(&chain_config_path, config_doc.to_string())
.with_context(|| format!("write config to {:?}", &chain_config_path))?;

// init axon
let init_command = ChildProcess::new(
Command::new("axon")
.arg("init")
.arg("--config")
.arg(&chain_config_path)
.arg("--chain-spec")
.arg(&chain_spec_path)
.arg("--key-file")
.arg(&key_file_path)
.current_dir(&working_dir)
.stdout(Stdio::null())
.stderr(Stdio::null())
.spawn()
.unwrap(),
);

// start process
let chain_process = ChildProcess::new(
Command::new("axon")
.arg("run")
.arg("-c")
.arg(&chain_config_path)
.arg("-g")
.arg(&genesis_config_path)
.current_dir(&working_dir)
.stdout(Stdio::null())
.stderr(Stdio::null())
Expand Down

0 comments on commit 32f6766

Please sign in to comment.