diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 22024e8e2f0..8d1d60c3413 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -277,7 +277,7 @@ It can be done by running: ```bash # compile executor without optimizations -cargo run --bin iroha_wasm_builder_cli -- build ./path/to/executor --outfile executor.wasm +cargo run --bin wasm_builder -- build ./path/to/executor --outfile executor.wasm ``` With profiling feature enabled Iroha exposes endpoint to scrap pprof profiles: diff --git a/Cargo.lock b/Cargo.lock index d51bc57ea19..6a863cd89e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3502,17 +3502,6 @@ dependencies = [ "wasm-opt", ] -[[package]] -name = "iroha_wasm_builder_cli" -version = "2.0.0-pre-rc.21" -dependencies = [ - "clap", - "color-eyre", - "iroha_wasm_builder", - "owo-colors", - "spinoff", -] - [[package]] name = "iroha_wasm_codec" version = "2.0.0-pre-rc.21" @@ -6497,6 +6486,17 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "wasm_builder_cli" +version = "2.0.0-pre-rc.21" +dependencies = [ + "clap", + "color-eyre", + "iroha_wasm_builder", + "owo-colors", + "spinoff", +] + [[package]] name = "wasmparser" version = "0.116.1" diff --git a/default_executor/README.md b/default_executor/README.md index 0fe04b6fe24..4b5934d2824 100644 --- a/default_executor/README.md +++ b/default_executor/README.md @@ -3,6 +3,6 @@ Use the [Wasm Builder CLI](../tools/wasm_builder_cli) in order to build it: ```bash -cargo run --bin iroha_wasm_builder_cli -- \ +cargo run --bin wasm_builder -- \ build ./default_executor --optimize --outfile ./configs/swarm/executor.wasm -``` \ No newline at end of file +``` diff --git a/hooks/pre-commit.sample b/hooks/pre-commit.sample index a175705e418..747690e966f 100755 --- a/hooks/pre-commit.sample +++ b/hooks/pre-commit.sample @@ -10,7 +10,7 @@ cd ./client/tests/integration/smartcontracts cargo fmt --all -- --check cd - # update the default executor -cargo run --release --bin iroha_wasm_builder_cli -- build ./default_executor --optimize --outfile ./configs/swarm/executor.wasm +cargo run --release --bin wasm_builder -- build ./default_executor --optimize --outfile ./configs/swarm/executor.wasm # update the default genesis, assuming the transaction authority is `test_samples::SAMPLE_GENESIS_ACCOUNT_ID` cargo run --release --bin kagami -- genesis --executor-path-in-genesis ./executor.wasm --genesis-public-key ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 > ./configs/swarm/genesis.json # update schema diff --git a/scripts/generate_wasm.sh b/scripts/generate_wasm.sh index e693108933f..1f37e53d5d0 100755 --- a/scripts/generate_wasm.sh +++ b/scripts/generate_wasm.sh @@ -20,7 +20,7 @@ for folder in "$SOURCE_DIR"/*; do folder_name=$(basename "$folder") target_wasm_file_path="${TARGET_DIR}/${folder_name}.wasm" # Build the smart contracts - cargo run --bin iroha_wasm_builder_cli -- build "$folder" --optimize --outfile "$target_wasm_file_path" + cargo run --bin wasm_builder -- build "$folder" --optimize --outfile "$target_wasm_file_path" fi done diff --git a/tools/wasm_builder_cli/Cargo.toml b/tools/wasm_builder_cli/Cargo.toml index b884ac5c196..73ce759fc4b 100644 --- a/tools/wasm_builder_cli/Cargo.toml +++ b/tools/wasm_builder_cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "iroha_wasm_builder_cli" +name = "wasm_builder_cli" edition.workspace = true version.workspace = true @@ -9,6 +9,10 @@ license.workspace = true [lints] workspace = true +[[bin]] +name = "wasm_builder" +path = "src/main.rs" + [dependencies] iroha_wasm_builder.workspace = true diff --git a/tools/wasm_builder_cli/README.md b/tools/wasm_builder_cli/README.md index 9585039b2fc..b7efc4c7776 100644 --- a/tools/wasm_builder_cli/README.md +++ b/tools/wasm_builder_cli/README.md @@ -1,23 +1,23 @@ -# `iroha_wasm_builder_cli` +# `wasm_builder` -A CLI around [`iroha_wasm_builder`](../wasm_builder) crate. +A CLI for building wasm smartcontracts. ## Usage **Check the smartcontract:** ```bash -iroha_wasm_builder_cli check path/to/project +wasm_builder check path/to/project ``` **Build the smartcontract:** ```bash -iroha_wasm_builder_cli build path/to/project --outfile ./smartcontract.wasm +wasm_builder build path/to/project --outfile ./smartcontract.wasm ``` **Build with options:** ```bash -iroha_wasm_builder_cli build path/to/project --optimize --format --outfile ./smartcontract.wasm +wasm_builder build path/to/project --optimize --format --outfile ./smartcontract.wasm ``` diff --git a/tools/wasm_builder_cli/src/main.rs b/tools/wasm_builder_cli/src/main.rs index 645b079a451..151073039a0 100644 --- a/tools/wasm_builder_cli/src/main.rs +++ b/tools/wasm_builder_cli/src/main.rs @@ -8,7 +8,7 @@ use iroha_wasm_builder::Builder; use owo_colors::OwoColorize; #[derive(Parser, Debug)] -#[command(name = "iroha_wasm_builder_cli", version, author)] +#[command(name = "wasm_builder", version, author)] enum Cli { /// Apply `cargo check` to the smartcontract Check {