Skip to content

Commit

Permalink
refactor(irohad): rename iroha to irohad
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 28, 2024
1 parent f41b080 commit 63618df
Show file tree
Hide file tree
Showing 53 changed files with 157 additions and 396 deletions.
148 changes: 0 additions & 148 deletions .github/workflows/iroha2-release-pr.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/iroha2-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,3 @@ jobs:
hyperledger/iroha:${{ env.TAG }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}
labels: commit=${{ github.sha }}

configs:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: iroha2-dev
token: ${{ secrets.G_ACCESS_TOKEN }}
- name: Update configs
run: |
./scripts/update_configs.sh lts
./scripts/update_configs.sh stable
- name: Commit config changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[documentation]: Update lts/stable configs following a release'
branch: iroha2-dev
commit_options: '--signoff'
commit_user_name: sorabot
commit_user_email: <>
commit_author: sorabot <[email protected]>
30 changes: 15 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ To pass the *`check-PR-title`* check, the pull request title must adhere to the
<details> <summary> Expand to read the detailed title guidelines</summary>

1. Follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-multi-paragraph-body-and-multiple-footers) format.

2. If the pull request has a single commit, the PR title should be the same as the commit message.

</details>
Expand Down Expand Up @@ -217,11 +217,11 @@ Set the `LOG_FILE_PATH` environment variable to an appropriate location to store

### Debugging using tokio console

<details> <summary> Expand to learn how to compile iroha with tokio console support.</summary>
<details> <summary> Expand to learn how to compile Iroha with tokio console support.</summary>

Sometimes it might be helpful for debugging to analyze tokio tasks using [tokio-console](https://github.com/tokio-rs/console).

In this case you should compile iroha with support of tokio console like that:
In this case you should compile Iroha with support of tokio console like that:

```bash
RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console
Expand All @@ -230,34 +230,34 @@ RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console
Port for tokio console can by configured through `LOG_TOKIO_CONSOLE_ADDR` configuration parameter (or environment variable).
Using tokio console require log level to be `TRACE`, can be enabled through configuration parameter or environment variable `LOG_LEVEL`.

Example of running iroha with tokio console support using `scripts/test_env.sh`:
Example of running Iroha with tokio console support using `scripts/test_env.sh`:

```bash
# 1. Compile iroha
# 1. Compile Iroha
RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console
# 2. Run iroha with TRACE log level
# 2. Run Iroha with TRACE log level
LOG_LEVEL=TRACE ./scripts/test_env.sh setup
# 3. Access iroha. Peers will be available on ports 5555, 5556, ...
# 3. Access Iroha. Peers will be available on ports 5555, 5556, ...
tokio-console http://127.0.0.1:5555
```

</details>

### Profiling

<details> <summary> Expand to learn ho to profile iroha. </summary>
<details> <summary> Expand to learn ho to profile Iroha. </summary>

To optimize performance it's useful to profile iroha.
To optimize performance it's useful to profile Iroha.

To do that you should compile iroha with `profiling` profile and with `profiling` feature:
To do that you should compile Iroha with `profiling` profile and with `profiling` feature:

```bash
RUSTFLAGS="-C force-frame-pointers=on" cargo +nightly -Z build-std build --target your-desired-target --profile profiling --features profiling
```

Then start iroha and attach profiler of your choice to the iroha pid.
Then start Iroha and attach profiler of your choice to the Iroha pid.

Alternatively it's possible to build iroha inside docker with profiler support and profile iroha this way.
Alternatively it's possible to build Iroha inside docker with profiler support and profile Iroha this way.

```bash
docker build -f Dockerfile.glibc --build-arg="PROFILE=profiling" --build-arg='RUSTFLAGS=-C force-frame-pointers=on' --build-arg='FEATURES=profiling' --build-arg='CARGOFLAGS=-Z build-std' -t iroha:profiling .
Expand All @@ -272,18 +272,18 @@ sudo perf record -g -p <PID>
sudo perf report
```

To be able to observe profile of the executor during iroha profiling, executor should be compiled without stripping symbols.
To be able to observe profile of the executor during Iroha profiling, executor should be compiled without stripping symbols.
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
```

With profiling feature enabled iroha exposes endpoint to scrap pprof profiles:
With profiling feature enabled Iroha exposes endpoint to scrap pprof profiles:

```bash
# profile iroha for 30 seconds and get protobuf profile
# profile Iroha for 30 seconds and get protobuf profile
curl host:port/debug/pprof/profile?seconds=30 -o profile.pb
# analyze profile in browser (required installed go)
go tool pprof -web profile.pb
Expand Down
75 changes: 37 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 63618df

Please sign in to comment.