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/README.md b/README.md index 505960c5d..e15451748 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ $ yarn migrate > migrate.log | tail -f migrate.log After running `yarn migrate`, the `OwnableIBCHandler` address is listing in console, we record it and mark as **`YOUR_IBC_AXON_ADDRESS`** to use later. ### Contract Deployment on CKB -Detailed deployment steps can be found in [ibc-ckb-contracts](https://github.com/synapseweb3/ibc-ckb-contracts). Alternatively, you can find pre-deployed contracts TYPE_ARGS on both testnet and mainnet: +Detailed deployment steps can be found in [forcerelay-ckb-contracts](https://github.com/synapseweb3/forcerelay-ckb-contracts). Alternatively, you can find pre-deployed contracts TYPE_ARGS on both testnet and mainnet: ||Mainnet|Testnet| |-|-|-| |connection|WIP|WIP| @@ -58,7 +58,7 @@ Unlike Axon, business modules cannot be registered directly with a contract on C It's important to note that the IBC port on CKB corresponds to the `LOCK_HASH` of your wallet cell on CKB, which we will refer to as `WALLET_LOCK_HASH` for future use. ### Installation and Setting -We recommand you to download the pre-compiled binary, or you can compile mannully from the source code, which requires `Rust ^v1.72.0` installed: +We recommend you to download the pre-compiled binary, or you can compile mannully from the source code, which requires `Rust ^v1.72.0` installed: ``` $ git clone https://github.com/synapseweb3/forcerelay diff --git a/tools/ibc-test/README.md b/tools/ibc-test/README.md index a9aa4d8be..e3e0d6293 100644 --- a/tools/ibc-test/README.md +++ b/tools/ibc-test/README.md @@ -27,7 +27,7 @@ Environment variables: ``` bash # IBC contracts -export IBC_CONTRACTS_SRC_PATH = +export IBC_CONTRACTS_SRC_PATH= cd $IBC_CONTRACTS_SRC_PATH && yarn install && yarn compile # Axon diff --git a/tools/ibc-test/src/framework/utils/axon.rs b/tools/ibc-test/src/framework/utils/axon.rs index 680aa4f5b..326ddba23 100644 --- a/tools/ibc-test/src/framework/utils/axon.rs +++ b/tools/ibc-test/src/framework/utils/axon.rs @@ -48,11 +48,16 @@ pub(crate) fn prepare_axon_chain( working_dir.push(dir_path); let _ = std::fs::remove_dir_all(dir_path); std::fs::create_dir_all(dir_path).with_context(|| format!("create_dir {:?}", dir_path))?; + let binding = working_dir.join("specs/single_node"); + let chain_spec_dir_path = binding.to_str().unwrap(); + std::fs::create_dir_all(chain_spec_dir_path) + .with_context(|| format!("create_chain_spec_dir {:?}", chain_spec_dir_path))?; // 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 +66,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 +100,27 @@ 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 = 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()) + .output() + .expect("axon init fail"); + // start process let chain_process = ChildProcess::new( Command::new("axon") .arg("run") - .arg("-c") + .arg("--config") .arg(&chain_config_path) - .arg("-g") - .arg(&genesis_config_path) .current_dir(&working_dir) .stdout(Stdio::null()) .stderr(Stdio::null()) @@ -144,6 +163,16 @@ pub(crate) fn prepare_axon_chain( Ok(chain_process) } +#[test] +fn test_command() { + let init_command = Command::new("ls") + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .output() + .expect("axon init fail"); + println!("{:?}", init_command); +} + fn check_command_output(output: &Output, working_dir: &Path) -> Result<()> { if !output.status.success() { let log_path = working_dir.join("deploy.log");