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 26, 2023
1 parent 4205215 commit 2af9cd5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ibc-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
timeout-minutes: 60
env:
SRC_DIR: ${{ github.workspace }}/ibc-test-src
AXON_COMMIT: d03d2bb7cb3dcdc03319c3a74beeee6715e7f448
AXON_COMMIT: 7ae0a826647d07e0b25b4adb440a8c97231d6a04
IBC_CONTRACT_COMMIT: 5746d048304ca4d73dc4800459ddd79d57fa124c
strategy:
fail-fast: false
Expand Down
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 2af9cd5

Please sign in to comment.