diff --git a/.github/workflows/ibc-test.yaml b/.github/workflows/ibc-test.yaml index d5f2f1779..6e147053a 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: 51179a38be36d3f13884ba4cd804cc9276c7b72c IBC_CONTRACT_COMMIT: 5746d048304ca4d73dc4800459ddd79d57fa124c strategy: fail-fast: false diff --git a/Cargo.lock b/Cargo.lock index 702df4781..6370dce27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,13 +353,12 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axon-tools" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945cf176886c0eefa5e85565124fb3e23c5078adfb3eab6baeb6263d78ef0d3f" dependencies = [ "bit-vec", "blst", "bytes", "cita_trie", + "derive_more", "ethereum-types", "faster-hex 0.6.1", "rlp", 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/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 4ec2c8b5b..513495f9b 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -52,7 +52,7 @@ tree_hash_derive = { git = "https://github.com/synapseweb3/lighthouse", rev = "2 thiserror = "1.0" ethereum-types = "0.14.1" hex = "0.4" -axon-tools = { version = "0.1.1", features = ["impl-serde", "proof"] } +axon-tools = { path = "/root/git/axon-tools/axon-tools", version = "0.1.1", features = ["impl-serde", "proof"] } strum = { version = "0.24.1", features = ["derive"] } [dependencies.tendermint] diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 4ef5e839d..724eada1e 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -34,7 +34,7 @@ tree_hash = { git = "https://github.com/synapseweb3/lighthouse", rev = "2c246d6" eth_light_client_in_ckb-verification = { version = "0.2.1", git = "https://github.com/synapseweb3/eth-light-client-in-ckb", tag = "v0.2.1" } eth_light_client_in_ckb-prover = { version = "0.2.1", git = "https://github.com/synapseweb3/eth-light-client-in-ckb", tag = "v0.2.1" } -axon-tools = { version = "0.1.1", features = ["proof", "impl-serde"] } +axon-tools = { path = "/root/git/axon-tools/axon-tools", version = "0.1.1", features = ["proof", "impl-serde"] } subtle-encoding = "0.5" humantime-serde = "1.1.1" 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..ef604050d 100644 --- a/tools/ibc-test/src/framework/utils/axon.rs +++ b/tools/ibc-test/src/framework/utils/axon.rs @@ -48,20 +48,27 @@ 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("devtools/chain/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", + "specs/single_node/genesis_transactions.json", + "debug.key", "default.db-options", ] { let src_path = axon_src_path.join("devtools/chain").join(file); - std::fs::copy(&src_path, working_dir.join(file)) + std::fs::copy(&src_path, working_dir.join("devtools/chain").join(file)) .with_context(|| format!("cp {:?} -> {:?}", &src_path, working_dir.join(file)))?; } - let chain_config_path = working_dir.join("config.toml"); - let genesis_config_path = working_dir.join("genesis_single_node.json"); + let chain_config_path = working_dir.join("devtools/chain").join("config.toml"); + let chain_spec_path = working_dir.join("devtools/chain").join("specs/single_node/chain-spec.toml"); + let key_file_path = working_dir.join("devtools/chain").join("debug.key"); // Modify configs @@ -94,14 +101,26 @@ 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()?; + // 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");