Skip to content

Commit

Permalink
refactor!: rename wasm_builder_cli to wasm_builder
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed May 29, 2024
1 parent 35d057f commit 1051e03
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 iroha_wasm_builder -- build ./path/to/executor --outfile executor.wasm
```

With profiling feature enabled Iroha exposes endpoint to scrap pprof profiles:
Expand Down
4 changes: 2 additions & 2 deletions default_executor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 iroha_wasm_builder -- \
build ./default_executor --optimize --outfile ./configs/swarm/executor.wasm
```
```
2 changes: 1 addition & 1 deletion hooks/pre-commit.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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 iroha_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
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 iroha_wasm_builder -- build "$folder" --optimize --outfile "$target_wasm_file_path"

fi
done
Expand Down
4 changes: 4 additions & 0 deletions tools/wasm_builder_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ license.workspace = true
[lints]
workspace = true

[[bin]]
name = "iroha_wasm_builder"
path = "src/main.rs"

[dependencies]
iroha_wasm_builder.workspace = true

Expand Down
10 changes: 5 additions & 5 deletions tools/wasm_builder_cli/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# `iroha_wasm_builder_cli`
# `iroha_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
iroha_wasm_builder check path/to/project
```

**Build the smartcontract:**

```bash
iroha_wasm_builder_cli build path/to/project --outfile ./smartcontract.wasm
iroha_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
iroha_wasm_builder build path/to/project --optimize --format --outfile ./smartcontract.wasm
```
2 changes: 1 addition & 1 deletion tools/wasm_builder_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "iroha_wasm_builder", version, author)]
enum Cli {
/// Apply `cargo check` to the smartcontract
Check {
Expand Down

0 comments on commit 1051e03

Please sign in to comment.