Skip to content

[suggestion] Refactor Iroha CLI #4136

@0x009922

Description

@0x009922

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

Metadata

Metadata

Assignees

Labels

CLIRefactorImprovement to overall code qualityconfig-changesChanges in configuration and start up of the Irohairoha2-devThe re-implementation of a BFT hyperledger in RUST

Type

No type

Projects

Status

In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions