Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[suggestion] Refactor Iroha CLI #4136

Closed
4 of 6 tasks
0x009922 opened this issue Dec 11, 2023 · 0 comments · Fixed by #5124
Closed
4 of 6 tasks

[suggestion] Refactor Iroha CLI #4136

0x009922 opened this issue Dec 11, 2023 · 0 comments · Fixed by #5124
Assignees
Labels
CLI config-changes Changes in configuration and start up of the Iroha iroha2-dev The re-implementation of a BFT hyperledger in RUST Refactor Improvement to overall code quality

Comments

@0x009922
Copy link
Contributor

0x009922 commented Dec 11, 2023

Description

Apart from not using clap, the CLI (iroha binary) has other issues:

  • It is simultaneously a binary and a library, which looks confusing IMO. It is this way so test_network crate can re-use Iroha root orchestrator in test env
  • As a library, it exports iroha::samples with data samples for tests. Doesn't seem to relate to CLI at all.
  • Torii is defined here; again, it is not really related to CLI and rather deserves to be moved somewhere.

To address this issues and make another steps towards the Configuration Overhaul RFC (#2585), I propose the following actions.

Actions

  • Remove Torii from iroha; make it a separate iroha_torii crate. It is a self-contained module, focusing on Iroha HTTP API. While core enough to belong to iroha_core (like Sumeragi or Kura), IMO it would better be a separate crate because its peripheral role, and it's a good candidate to be a standalone compilation unit.
  • Remove global panic hook setting from Iroha startup; set it up on a higher level (e.g. CLI)
  • Remove iroha::samples from iroha; maybe, make a separate test_samples crate or something.
  • Consider moving Iroha structure & logic out of CLI, e.g. into iroha_orchestrator or something.
  • [suggestion] Rewrite the iroha_cli entrypoint using clap #4105 (+ bump clap version of iroha_client_cli)
  • Additionally, remove setting genesis file through CLI and introduce genesis.file configuration parameter as outlined in [suggestion] Simplify genesis config #4029
@0x009922 0x009922 added iroha2-dev The re-implementation of a BFT hyperledger in RUST CLI config-changes Changes in configuration and start up of the Iroha Refactor Improvement to overall code quality labels Dec 11, 2023
@0x009922 0x009922 self-assigned this Dec 11, 2023
0x009922 added a commit that referenced this issue Dec 22, 2023
* [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 (#3075)
- `iroha_genesis`: remove `pub` to guard invariant of `GenesisNetwork`

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: chore

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 (#3506)
- `iroha`: resolve all relative paths in config file
- `iroha`: improve config error messages
- `iroha`: add config integration tests

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

* [fix]: clippy, tests

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: use `serde_as_str` for paths

Signed-off-by: Dmitry Balashov <[email protected]>

* [chore]: re-generate peer config

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: update `test_env.py`

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: remove deprecated option from test config

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update README

Signed-off-by: Dmitry Balashov <[email protected]>

* [chore]: remove obsolete comment

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: update `iroha_swarm`

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

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: chores

Signed-off-by: Dmitry Balashov <[email protected]>

* Apply suggestions from code review

Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: align `StatusFailure` message

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: adopt suggestion in `iroha_client_cli`

#4153 (comment)
Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [feat]: refine genesis config parse error

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: fix CANNOT_BE_EMPTY message

It is updated with a new version of clap

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

* [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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

* Update client_cli/src/main.rs

Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

* [refactor]: eliminate extra `iroha_config` dependency

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: remove dead code

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: remove `disable_panic_terminal_colors` parameter

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update genesis topology messages

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: typo

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: inherit env from OS

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: link issue #4161

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: format

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: apply lints

Signed-off-by: Dmitry Balashov <[email protected]>

* [feat]: panic on default path extension

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: update err message

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update docs of `read_config`

Signed-off-by: Dmitry Balashov <[email protected]>

---------

Signed-off-by: Dmitry Balashov <[email protected]>
Signed-off-by: 0x009922 <[email protected]>
Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Asem-Abdelhady pushed a commit to Asem-Abdelhady/iroha that referenced this issue Jan 9, 2024
…ctor CLIs (hyperledger#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#3075)
- `iroha_genesis`: remove `pub` to guard invariant of `GenesisNetwork`

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: chore

Signed-off-by: Dmitry Balashov <[email protected]>

* [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#3506)
- `iroha`: resolve all relative paths in config file
- `iroha`: improve config error messages
- `iroha`: add config integration tests

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

* [fix]: clippy, tests

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: use `serde_as_str` for paths

Signed-off-by: Dmitry Balashov <[email protected]>

* [chore]: re-generate peer config

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: update `test_env.py`

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: remove deprecated option from test config

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update README

Signed-off-by: Dmitry Balashov <[email protected]>

* [chore]: remove obsolete comment

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: update `iroha_swarm`

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

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: chores

Signed-off-by: Dmitry Balashov <[email protected]>

* Apply suggestions from code review

Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: align `StatusFailure` message

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: adopt suggestion in `iroha_client_cli`

hyperledger#4153 (comment)
Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [feat]: refine genesis config parse error

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: fix CANNOT_BE_EMPTY message

It is updated with a new version of clap

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

* [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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

* Update client_cli/src/main.rs

Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

* [refactor]: eliminate extra `iroha_config` dependency

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: remove dead code

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: remove `disable_panic_terminal_colors` parameter

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update genesis topology messages

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: typo

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: inherit env from OS

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: link issue hyperledger#4161

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: format

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: apply lints

Signed-off-by: Dmitry Balashov <[email protected]>

* [feat]: panic on default path extension

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: update err message

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update docs of `read_config`

Signed-off-by: Dmitry Balashov <[email protected]>

---------

Signed-off-by: Dmitry Balashov <[email protected]>
Signed-off-by: 0x009922 <[email protected]>
Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Asem-Abdelhady pushed a commit to Asem-Abdelhady/iroha that referenced this issue Jan 22, 2024
…ctor CLIs (hyperledger#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#3075)
- `iroha_genesis`: remove `pub` to guard invariant of `GenesisNetwork`

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: chore

Signed-off-by: Dmitry Balashov <[email protected]>

* [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#3506)
- `iroha`: resolve all relative paths in config file
- `iroha`: improve config error messages
- `iroha`: add config integration tests

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

* [fix]: clippy, tests

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: use `serde_as_str` for paths

Signed-off-by: Dmitry Balashov <[email protected]>

* [chore]: re-generate peer config

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: update `test_env.py`

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: remove deprecated option from test config

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update README

Signed-off-by: Dmitry Balashov <[email protected]>

* [chore]: remove obsolete comment

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: update `iroha_swarm`

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

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: chores

Signed-off-by: Dmitry Balashov <[email protected]>

* Apply suggestions from code review

Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: align `StatusFailure` message

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: adopt suggestion in `iroha_client_cli`

hyperledger#4153 (comment)
Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [feat]: refine genesis config parse error

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: fix CANNOT_BE_EMPTY message

It is updated with a new version of clap

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

* [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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

* Update client_cli/src/main.rs

Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

* [refactor]: eliminate extra `iroha_config` dependency

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: remove dead code

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: remove `disable_panic_terminal_colors` parameter

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update genesis topology messages

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: typo

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: inherit env from OS

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: link issue hyperledger#4161

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: format

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: apply lints

Signed-off-by: Dmitry Balashov <[email protected]>

* [feat]: panic on default path extension

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: update err message

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update docs of `read_config`

Signed-off-by: Dmitry Balashov <[email protected]>

---------

Signed-off-by: Dmitry Balashov <[email protected]>
Signed-off-by: 0x009922 <[email protected]>
Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: Asem-Abdelhady <[email protected]>
Asem-Abdelhady pushed a commit to Asem-Abdelhady/iroha that referenced this issue Feb 9, 2024
…ctor CLIs (hyperledger#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#3075)
- `iroha_genesis`: remove `pub` to guard invariant of `GenesisNetwork`

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: chore

Signed-off-by: Dmitry Balashov <[email protected]>

* [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#3506)
- `iroha`: resolve all relative paths in config file
- `iroha`: improve config error messages
- `iroha`: add config integration tests

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

* [fix]: clippy, tests

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: use `serde_as_str` for paths

Signed-off-by: Dmitry Balashov <[email protected]>

* [chore]: re-generate peer config

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: update `test_env.py`

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: remove deprecated option from test config

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update README

Signed-off-by: Dmitry Balashov <[email protected]>

* [chore]: remove obsolete comment

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: update `iroha_swarm`

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

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: chores

Signed-off-by: Dmitry Balashov <[email protected]>

* Apply suggestions from code review

Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: align `StatusFailure` message

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: adopt suggestion in `iroha_client_cli`

hyperledger#4153 (comment)
Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [feat]: refine genesis config parse error

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: fix CANNOT_BE_EMPTY message

It is updated with a new version of clap

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

* [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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

* Update client_cli/src/main.rs

Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: 0x009922 <[email protected]>

* [refactor]: eliminate extra `iroha_config` dependency

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: remove dead code

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: remove `disable_panic_terminal_colors` parameter

Signed-off-by: Dmitry Balashov <[email protected]>

* [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 <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update genesis topology messages

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: typo

Signed-off-by: Dmitry Balashov <[email protected]>

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

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: inherit env from OS

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: link issue hyperledger#4161

Signed-off-by: Dmitry Balashov <[email protected]>

* [fix]: format

Signed-off-by: Dmitry Balashov <[email protected]>

* [refactor]: apply lints

Signed-off-by: Dmitry Balashov <[email protected]>

* [feat]: panic on default path extension

Signed-off-by: Dmitry Balashov <[email protected]>

* [test]: update err message

Signed-off-by: Dmitry Balashov <[email protected]>

* [docs]: update docs of `read_config`

Signed-off-by: Dmitry Balashov <[email protected]>

---------

Signed-off-by: Dmitry Balashov <[email protected]>
Signed-off-by: 0x009922 <[email protected]>
Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
Co-authored-by: ⭐️NINIKA⭐️ <[email protected]>
@0x009922 0x009922 linked a pull request Oct 9, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI config-changes Changes in configuration and start up of the Iroha iroha2-dev The re-implementation of a BFT hyperledger in RUST Refactor Improvement to overall code quality
Projects
Status: In review
2 participants