From 2af9cd59a2f5547541c8153143ff8990b4c628e1 Mon Sep 17 00:00:00 2001 From: wenyuanhust Date: Tue, 26 Sep 2023 10:50:13 +0800 Subject: [PATCH] refactor: sync with axon new start commands --- .github/workflows/ibc-test.yaml | 2 +- tools/ibc-test/src/framework/utils/axon.rs | 25 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ibc-test.yaml b/.github/workflows/ibc-test.yaml index d5f2f1779..ce607f62a 100644 --- a/.github/workflows/ibc-test.yaml +++ b/.github/workflows/ibc-test.yaml @@ -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 diff --git a/tools/ibc-test/src/framework/utils/axon.rs b/tools/ibc-test/src/framework/utils/axon.rs index 680aa4f5b..222b3ddae 100644 --- a/tools/ibc-test/src/framework/utils/axon.rs +++ b/tools/ibc-test/src/framework/utils/axon.rs @@ -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); @@ -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 @@ -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())