forked from hyperledger-iroha/iroha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpre-commit.sample
executable file
·25 lines (25 loc) · 1.51 KB
/
pre-commit.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# rustup default nightly-2024-04-18
set -e
# format checks
cargo fmt --all -- --check
cd ./wasm_samples/default_executor
cargo fmt --all -- --check
cd -
cd ./wasm_samples
cargo fmt --all -- --check
cd -
# update the default executor
cargo run --release --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ./defaults/executor.wasm
# update the default genesis, assuming the transaction authority is `test_samples::SAMPLE_GENESIS_ACCOUNT_ID`
cargo run --release --bin kagami -- genesis generate --executor-path-in-genesis ./executor.wasm --genesis-public-key ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4 > ./defaults/genesis.json
# update schema
cargo run --release --bin kagami -- schema > ./docs/source/references/schema.json
# update docker compose files
cargo run --release --bin iroha_swarm -- -p 1 -s Iroha -H -c ./defaults -i hyperledger/iroha:local -b . -o ./defaults/docker-compose.single.yml -F
cargo run --release --bin iroha_swarm -- -p 4 -s Iroha -H -c ./defaults -i hyperledger/iroha:local -b . -o ./defaults/docker-compose.local.yml -F
cargo run --release --bin iroha_swarm -- -p 4 -s Iroha -H -c ./defaults -i hyperledger/iroha:dev -o ./defaults/docker-compose.yml -F
# lints
cargo lints clippy --workspace --benches --tests --examples --all-features
# stage updates
git add ./defaults/executor.wasm ./defaults/genesis.json ./docs/source/references/schema.json ./defaults/docker-compose.single.yml ./defaults/docker-compose.local.yml ./defaults/docker-compose.yml