Skip to content

[refactor] #4029, #4105, #4136: refactor CLIs#4153

Merged
0x009922 merged 43 commits intohyperledger-iroha:iroha2-devfrom
0x009922:refactor-cli
Dec 22, 2023
Merged

[refactor] #4029, #4105, #4136: refactor CLIs#4153
0x009922 merged 43 commits intohyperledger-iroha:iroha2-devfrom
0x009922:refactor-cli

Conversation

@0x009922
Copy link
Copy Markdown
Contributor

@0x009922 0x009922 commented Dec 15, 2023

Description

Changes:

  • iroha_genesis:
    • Refactor GenesisNetwork initialisation, remove side effects and simplify logic
    • Make transactions in GenesisNetwork non-public, to avoid invariant violation
  • iroha_config:
    • Update Genesis config: instead of account_public_key and account_private_key, it now has public_key, private_key, and file options (according to [suggestion] Simplify genesis config #4029). Move some validation logic here (in form of ParsedConfiguration struct).
    • Finally, remove disable_panic_terminal_colors deprecated parameter
    • Use PathBufs for all path parameters (genesis.file, kura.block_store_path, snapshot.dir_path, telemetry.file)
    • Update Path (multiple extensions support) behaviour
  • iroha:
    • Use clap
    • Update CLI itself: --config argument, --terminal-colors (or --terminal-colors=false). --submit-genesis remains as is.
    • Update configuration pipeline:
      • Steps: defaults → file → env → build → validate & parse
      • If file is not specified, Iroha tries both config.json and config.json5 and doesn't fail if they are not find (same as before)
      • If file is user-provided (--config, IROHA_CONFIG=) and it is not found, Iroha fails (previously it didn't)
      • Read and parse ENV after file, not before
      • Resolve paths in the config file relatively to its location
  • iroha_client_cli:
    • Update clap to v4, as in the rest of workspace
    • Refactor --metadata argument
    • Adopt the same configuration pipeline as in iroha
  • iroha_swarm: explicitly specifies config.json and genesis.json paths in the generated docker-compose configurations
  • kagami: kagami config peer now accepts an optional argument --genesis-file-in-config <PATH> to set genesis.file in the output. Semantic analogous to kagami genesis --executor-path-in-genesis <PATH>.

Linked issues

Closes #4029 #4105, partially addresses #4136

Benefits

  • Improves UX of configuration & usage of iroha and iroha_client_cli
  • Moves more configuration responsibility to iroha_config
  • Reduces complexity of init logic a little

Checklist

@0x009922 0x009922 added iroha2-dev The re-implementation of a BFT hyperledger in RUST Documentation Documentation changes api-changes Changes in the API for client libraries config-changes Changes in configuration and start up of the Iroha Refactor Improvement to overall code quality UI Something about the interface labels Dec 15, 2023
@0x009922 0x009922 self-assigned this Dec 15, 2023
@0x009922 0x009922 changed the title [refactor]: split iroha_torii from iroha [refactor] #4029, #4105, #4136: refactor CLIs Dec 15, 2023
@Arjentix Arjentix self-assigned this Dec 15, 2023
0x009922 added a commit to 0x009922/iroha that referenced this pull request Dec 17, 2023
hyperledger-iroha#4153 (comment)
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
@0x009922 0x009922 marked this pull request as ready for review December 18, 2023 06:36
@timofeevmd timofeevmd self-assigned this Dec 18, 2023
@0x009922 0x009922 requested a review from outoftardis December 18, 2023 06:58
@DCNick3 DCNick3 self-assigned this Dec 18, 2023
0x009922 and others added 20 commits December 22, 2023 03:52
- set `GENESIS_FILE` in env, since `config.json` doesn't have it
- strictly specify `config.json` and `genesis.json` files

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>
Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
- remove `cfg(test)` behaviour from `GenesisNetwork::new()`
- refactor `impl TestGenesis for Genesis`
  - remove extra `bool` + `Option` invariant
  - allow creating genesis with additional ISIs
- remove `test-utils` feature & `GenesisNetwork::transactions_mut()`
- update related tests
- update error message on signing failure

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
@0x009922 0x009922 requested a review from outoftardis December 22, 2023 07:30
@0x009922 0x009922 merged commit 54e65c5 into hyperledger-iroha:iroha2-dev Dec 22, 2023
@0x009922 0x009922 deleted the refactor-cli branch December 22, 2023 08:33
Asem-Abdelhady pushed a commit to Asem-Abdelhady/iroha that referenced this pull request Jan 9, 2024
…r-iroha#4136: refactor CLIs (hyperledger-iroha#4153)

* [refactor]: refactor cli(s)

- `iroha`: use `clap` `v4`
- `iroha`: update CLI (`--config`, `--terminal-colors`)
- `iroha`: handle user-provided config file strictly
- `iroha`: parse ENV config after file config
- `iroha_config`: add `genesis.file`, remove `account_*` prefix
- `iroha_config`: move some genesis config validation logic
  from `iroha`
- `iroha_client_cli`: upgrade `clap` to `v4`
- `iroha_genesis`: remove side effects (bail, logs)
- `iroha_genesis`: clarify validation logic (hyperledger-iroha#3075)
- `iroha_genesis`: remove `pub` to guard invariant of `GenesisNetwork`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: chore

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: fix & test config

- `iroha_config`: use `PathBuf` when appropriate
- `iroha_config`: fix `Path` behaviour
- `iroha_config`: finally, make `disable_panic_terminal_colors`
  truly optional (hyperledger-iroha#3506)
- `iroha`: resolve all relative paths in config file
- `iroha`: improve config error messages
- `iroha`: add config integration tests

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: test & refactor

- `iroha_client_cli`: adopt `--config` from `iroha`
- `iroha_client_cli`: refactor `--metadata` arg
- `iroha`: extend tests
- update test code overall

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: clippy, tests

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: use `serde_as_str` for paths

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [chore]: re-generate peer config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: update `test_env.py`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: remove deprecated option from test config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update README

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [chore]: remove obsolete comment

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: update `iroha_swarm`

Now it relies on that `genesis.file` is set in the config file

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: `kagami config peer` + `--genesis-file-in-config`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: chores

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ekaterina Mekhnetsova <mekkatya@gmail.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* [feat]: use `PATH` as value name

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: align `StatusFailure` message

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: adopt suggestion in `iroha_client_cli`

hyperledger-iroha#4153 (comment)
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [build]: exclude `genesis.file` from default config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: refine genesis config parse error

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: fix & refactor `test_env.py`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: fix CANNOT_BE_EMPTY message

It is updated with a new version of clap

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: return `disable_panic_terminal_colors: null` to test config

It is needed so that only `iroha_test_config.json` without
defaults layer is valid (will fix on config refactoring)

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: handle configuration properly in `iroha_swarm`

- set `GENESIS_FILE` in env, since `config.json` doesn't have it
- strictly specify `config.json` and `genesis.json` files

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* Update client_cli/src/main.rs

Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* [refactor]: eliminate extra `iroha_config` dependency

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove dead code

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: use `serde_json::json!`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove `disable_panic_terminal_colors` parameter

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: update genesis & its testing

- remove `cfg(test)` behaviour from `GenesisNetwork::new()`
- refactor `impl TestGenesis for Genesis`
  - remove extra `bool` + `Option` invariant
  - allow creating genesis with additional ISIs
- remove `test-utils` feature & `GenesisNetwork::transactions_mut()`
- update related tests
- update error message on signing failure

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove extension check from `Path::default()`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update genesis topology messages

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: use `Popen`'s `env` instead of global `os.environ`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: typo

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: use `Partial`/`Full` terminology

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: inherit env from OS

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: link issue hyperledger-iroha#4161

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: format

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: apply lints

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: panic on default path extension

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: update err message

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update docs of `read_config`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

---------

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>
Co-authored-by: Ekaterina Mekhnetsova <mekkatya@gmail.com>
Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Asem-Abdelhady pushed a commit to Asem-Abdelhady/iroha that referenced this pull request Jan 22, 2024
…r-iroha#4136: refactor CLIs (hyperledger-iroha#4153)

* [refactor]: refactor cli(s)

- `iroha`: use `clap` `v4`
- `iroha`: update CLI (`--config`, `--terminal-colors`)
- `iroha`: handle user-provided config file strictly
- `iroha`: parse ENV config after file config
- `iroha_config`: add `genesis.file`, remove `account_*` prefix
- `iroha_config`: move some genesis config validation logic
  from `iroha`
- `iroha_client_cli`: upgrade `clap` to `v4`
- `iroha_genesis`: remove side effects (bail, logs)
- `iroha_genesis`: clarify validation logic (hyperledger-iroha#3075)
- `iroha_genesis`: remove `pub` to guard invariant of `GenesisNetwork`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: chore

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: fix & test config

- `iroha_config`: use `PathBuf` when appropriate
- `iroha_config`: fix `Path` behaviour
- `iroha_config`: finally, make `disable_panic_terminal_colors`
  truly optional (hyperledger-iroha#3506)
- `iroha`: resolve all relative paths in config file
- `iroha`: improve config error messages
- `iroha`: add config integration tests

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: test & refactor

- `iroha_client_cli`: adopt `--config` from `iroha`
- `iroha_client_cli`: refactor `--metadata` arg
- `iroha`: extend tests
- update test code overall

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: clippy, tests

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: use `serde_as_str` for paths

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [chore]: re-generate peer config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: update `test_env.py`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: remove deprecated option from test config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update README

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [chore]: remove obsolete comment

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: update `iroha_swarm`

Now it relies on that `genesis.file` is set in the config file

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: `kagami config peer` + `--genesis-file-in-config`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: chores

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ekaterina Mekhnetsova <mekkatya@gmail.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* [feat]: use `PATH` as value name

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: align `StatusFailure` message

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: adopt suggestion in `iroha_client_cli`

hyperledger-iroha#4153 (comment)
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [build]: exclude `genesis.file` from default config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: refine genesis config parse error

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: fix & refactor `test_env.py`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: fix CANNOT_BE_EMPTY message

It is updated with a new version of clap

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: return `disable_panic_terminal_colors: null` to test config

It is needed so that only `iroha_test_config.json` without
defaults layer is valid (will fix on config refactoring)

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: handle configuration properly in `iroha_swarm`

- set `GENESIS_FILE` in env, since `config.json` doesn't have it
- strictly specify `config.json` and `genesis.json` files

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* Update client_cli/src/main.rs

Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* [refactor]: eliminate extra `iroha_config` dependency

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove dead code

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: use `serde_json::json!`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove `disable_panic_terminal_colors` parameter

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: update genesis & its testing

- remove `cfg(test)` behaviour from `GenesisNetwork::new()`
- refactor `impl TestGenesis for Genesis`
  - remove extra `bool` + `Option` invariant
  - allow creating genesis with additional ISIs
- remove `test-utils` feature & `GenesisNetwork::transactions_mut()`
- update related tests
- update error message on signing failure

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove extension check from `Path::default()`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update genesis topology messages

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: use `Popen`'s `env` instead of global `os.environ`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: typo

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: use `Partial`/`Full` terminology

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: inherit env from OS

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: link issue hyperledger-iroha#4161

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: format

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: apply lints

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: panic on default path extension

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: update err message

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update docs of `read_config`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

---------

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>
Co-authored-by: Ekaterina Mekhnetsova <mekkatya@gmail.com>
Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: Asem-Abdelhady <asemshawkey@gmail.com>
Asem-Abdelhady pushed a commit to Asem-Abdelhady/iroha that referenced this pull request Feb 9, 2024
…r-iroha#4136: refactor CLIs (hyperledger-iroha#4153)

* [refactor]: refactor cli(s)

- `iroha`: use `clap` `v4`
- `iroha`: update CLI (`--config`, `--terminal-colors`)
- `iroha`: handle user-provided config file strictly
- `iroha`: parse ENV config after file config
- `iroha_config`: add `genesis.file`, remove `account_*` prefix
- `iroha_config`: move some genesis config validation logic
  from `iroha`
- `iroha_client_cli`: upgrade `clap` to `v4`
- `iroha_genesis`: remove side effects (bail, logs)
- `iroha_genesis`: clarify validation logic (hyperledger-iroha#3075)
- `iroha_genesis`: remove `pub` to guard invariant of `GenesisNetwork`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: chore

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: fix & test config

- `iroha_config`: use `PathBuf` when appropriate
- `iroha_config`: fix `Path` behaviour
- `iroha_config`: finally, make `disable_panic_terminal_colors`
  truly optional (hyperledger-iroha#3506)
- `iroha`: resolve all relative paths in config file
- `iroha`: improve config error messages
- `iroha`: add config integration tests

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: test & refactor

- `iroha_client_cli`: adopt `--config` from `iroha`
- `iroha_client_cli`: refactor `--metadata` arg
- `iroha`: extend tests
- update test code overall

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: clippy, tests

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: use `serde_as_str` for paths

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [chore]: re-generate peer config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: update `test_env.py`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: remove deprecated option from test config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update README

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [chore]: remove obsolete comment

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: update `iroha_swarm`

Now it relies on that `genesis.file` is set in the config file

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: `kagami config peer` + `--genesis-file-in-config`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: chores

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ekaterina Mekhnetsova <mekkatya@gmail.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* [feat]: use `PATH` as value name

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: align `StatusFailure` message

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: adopt suggestion in `iroha_client_cli`

hyperledger-iroha#4153 (comment)
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [build]: exclude `genesis.file` from default config

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: refine genesis config parse error

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: fix & refactor `test_env.py`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: fix CANNOT_BE_EMPTY message

It is updated with a new version of clap

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: return `disable_panic_terminal_colors: null` to test config

It is needed so that only `iroha_test_config.json` without
defaults layer is valid (will fix on config refactoring)

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: handle configuration properly in `iroha_swarm`

- set `GENESIS_FILE` in env, since `config.json` doesn't have it
- strictly specify `config.json` and `genesis.json` files

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* Update client_cli/src/main.rs

Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>

* [refactor]: eliminate extra `iroha_config` dependency

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove dead code

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: use `serde_json::json!`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove `disable_panic_terminal_colors` parameter

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: update genesis & its testing

- remove `cfg(test)` behaviour from `GenesisNetwork::new()`
- refactor `impl TestGenesis for Genesis`
  - remove extra `bool` + `Option` invariant
  - allow creating genesis with additional ISIs
- remove `test-utils` feature & `GenesisNetwork::transactions_mut()`
- update related tests
- update error message on signing failure

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: remove extension check from `Path::default()`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update genesis topology messages

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: use `Popen`'s `env` instead of global `os.environ`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: typo

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: use `Partial`/`Full` terminology

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: inherit env from OS

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: link issue hyperledger-iroha#4161

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [fix]: format

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [refactor]: apply lints

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [feat]: panic on default path extension

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [test]: update err message

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

* [docs]: update docs of `read_config`

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>

---------

Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>
Co-authored-by: Ekaterina Mekhnetsova <mekkatya@gmail.com>
Co-authored-by: ⭐️NINIKA⭐️ <DCNick3@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-changes Changes in the API for client libraries config-changes Changes in configuration and start up of the Iroha Documentation Documentation changes iroha2-dev The re-implementation of a BFT hyperledger in RUST Refactor Improvement to overall code quality UI Something about the interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants