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] Separate validator and swarm from Kagami #3833

Closed
Tracked by #2373
0x009922 opened this issue Aug 22, 2023 · 3 comments · Fixed by #3841
Closed
Tracked by #2373

[suggestion] Separate validator and swarm from Kagami #3833

0x009922 opened this issue Aug 22, 2023 · 3 comments · Fixed by #3841
Assignees
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix

Comments

@0x009922
Copy link
Contributor

0x009922 commented Aug 22, 2023

Description

Kagami was originally designed as an accompanying tool for the Iroha codebase. It was used to generate configuration, cryptographic keys, and more. Mentioned extensively in Iroha 2 documentation, it instructs users on deploying Iroha 2. However, some added functionalities have now limited its usability in some scenarios.

Commands overview

Kagami currently supports the following commands:

  • crypto: Generate cryptographic key pairs using the given algorithm and either a private key or seed
  • schema: Generate the schema for code generation in Iroha SDKs
  • genesis: Generate the genesis block that is used in tests
  • config: Generate the default client/peer configuration
  • docs: Generate a Markdown reference of configuration parameters
  • validator: Generate the default validator
  • swarm: Generate Docker Compose configuration

While most commands are self-contained, validator and swarm are exceptions with specific dependencies.

Issues

Proposed solution

To address these challenges, I propose to remove validator and swarm subcommands from Kagami. Thus, Kagami will remain a lightweight tool for both internal and external usage with ability to mention it in the documentation.

As for the validator and swarm, they could likely become separate binaries. The naming, location, and CLI for these new binaries is up to discussion.

Related

@0x009922 0x009922 added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Aug 22, 2023
@0x009922 0x009922 self-assigned this Aug 23, 2023
@0x009922
Copy link
Contributor Author

Excluding validator compilation from kagami genesis

Currently kagami genesis has the following mutually exclusive options:

  • --inlined-validator: Generates the validator and includes it in the JSON.
  • --compiled-validator-path <PATH>: Inserts the specified path into the JSON as is.

Since our goal is to remove validator compilation from Kagami, it needs to be refactored.

I propose the following options instead:

  • --inline-validator-from-file <PATH>: Reads the validator from the file at <PATH> (relative to CWD) and includes the content into the genesis.
  • --validator-path-in-genesis <PATH>: Specifies the <PATH> that will be directly inserted into the genesis JSON as-is. Essentially is the same as --compiled-validator-path, but I think the new naming is less confusing.

These options are still mutually exclusive.

@0x009922 0x009922 linked a pull request Aug 28, 2023 that will close this issue
3 tasks
0x009922 added a commit that referenced this issue Sep 4, 2023
* [refactor]: remove Swarm from Kagami; introduce refactored `iroha_swarm`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: remove validator from Kagami; cleanup

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [misc]: fix workspace info, introduce `wasm_builder_cli`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [ci]: update Genesis and Swarm cmds in scripts

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: produce workable `iroha_wasm_builder_cli`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: enhance CLI UI with spinners

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [build]: remove `iroha_wasm_builder` dep from Kagami

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [build]: tree-shake unused spinners

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [test]: fix swarm tests

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: add README for `iroha_swarm`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: remove `UserInterface` struct

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: add `--outfile` arg for wasm cli

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: document how to build the default validator

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [chore]: unused imports

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: link the directory to the cli

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: enhance warning about an inlined validator

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [chore]: use stdout

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: move `wasm_builder_cli` to `./tools/`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

---------

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
@0x009922
Copy link
Contributor Author

0x009922 commented Sep 5, 2023

Closed by #3841

@0x009922 0x009922 closed this as completed Sep 5, 2023
@0x009922
Copy link
Contributor Author

0x009922 commented Sep 5, 2023

Actually, it should be verified first.

@0x009922 0x009922 reopened this Sep 5, 2023
@timofeevmd timofeevmd self-assigned this Sep 6, 2023
@timofeevmd timofeevmd added the QA-confirmed This bug is reproduced and needs a fix label Sep 6, 2023
mversic pushed a commit that referenced this issue Oct 17, 2023
* [refactor]: remove Swarm from Kagami; introduce refactored `iroha_swarm`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: remove validator from Kagami; cleanup

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [misc]: fix workspace info, introduce `wasm_builder_cli`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [ci]: update Genesis and Swarm cmds in scripts

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: produce workable `iroha_wasm_builder_cli`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: enhance CLI UI with spinners

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [build]: remove `iroha_wasm_builder` dep from Kagami

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [build]: tree-shake unused spinners

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [test]: fix swarm tests

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: add README for `iroha_swarm`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: remove `UserInterface` struct

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: add `--outfile` arg for wasm cli

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: document how to build the default validator

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [chore]: unused imports

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: link the directory to the cli

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: enhance warning about an inlined validator

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [chore]: use stdout

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: move `wasm_builder_cli` to `./tools/`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

---------

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants