-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add an Iroha swarm analogue to Iroha 2 #2373
Comments
Hi! |
Existing developments: |
Make it a subcommand of |
So, what are the requirements for the tool, and what are the exact problems we need to solve? My understanding so far about the problems:
Could you desribe more with what @Mingela and DevOps struggle with? My understanding so far about the solution:
Help me to clarify things please. |
I agree with Dmitry here on having it as a part of Kagami: otherwise, it may get confusing, and Kagami-gui is planned anyway. The branch and release should be a parameter too, but not necessarily a required one.
We may have fewer options than Fish making the web config unnecessary. @appetrosyan mentioned that concept: https://lwn.net/Articles/832525/, https://fishshell.com/docs/current/cmds/fish_config.html |
Reference for Iroha v1 swarm, jfyi |
The tool will generate a directory with
I am not sure yet how to compose it all in a robust CLI interface, will do more research. Also, all of this could be prompted in an interactive mode. |
TBH it doesn’t have to be CLI. I would prefer a CLI tool, but that’s only because it’d be easier for us to maintain. |
What about a ncurses-based wizard, like https://docs.rs/tui/latest/tui/ at the start? I like the idea of making a new directory and not overwriting the config (although I may imagine batch scenarios when the output directory is a part of the configuration, too). In general, the concept looks reasonable. |
@appetrosyan, I think it would be easier to implement than building a complete GUI for Kagami. At least, for now. Or should I start working in this direction?
@6r1d, well... it is a UI already. I think TUI is something between CLI and GUI that might not find its target audience. GUI might a complete "friendly" and "nicely-looking" option instead of a CLI, but will TUI worth the effort? |
Let's go with a very basic |
After understanding more details of the task, I came to the conclusion that making
Thus, I came to a different understanding of how Kagami should handle different sources:
@appetrosyan @6r1d, please let me know what you think. |
So, channels are equal to branches, as we've just discussed.
Sounds reasonable.
Suppose our goal is to save time for the user by providing defaults. In that case, I expect this to break things further: users won't know anything about environment variables, and Iroha will stop working. |
* [refactor]: bump `clap`, scaffold `swarm` subcommand Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: transform `algorithm` to `ValueEnum` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [feature]: implement basic flow Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: clear dead code Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: safer paths manipulations Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: sort generated services Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [test]: update snapshot Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: skip empty command serialisation; chores Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: define consts Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: pass workspace check; lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: chores Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [feat]: impl basic UI Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: fix shallow git clone Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: update ui Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: simplify resolution reporting Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: doc comments, naming, etc Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: move `swarm` mod Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: chores; update doc comments Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: fix config path in docker image Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: clippy lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: specify all trusted peers; set genesis key pair only for the genesis peer Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: add fixme Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: chores Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [test]: fix `kagami` and `iroha_config_base` tests Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: use `SocketAddr` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: apply lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: allow any docker image; rename args Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: fix lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * Apply suggestions from code review Co-authored-by: Ilia Churin <churin.ilya@gmail.com> Signed-off-by: 0x009922 <a.marcius26@gmail.com> * [chore]: remove extra doc Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: remove inaccurate comment Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: use `.dir()` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: derive `Display` for `AlgorithmArg` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: use `Error::FieldDeserialization` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: apply lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: move secp256k1 seed len check to `iroha_crypto` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: expand `swarm::key_gen` module Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: fix format Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: capitalise error messages Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> --------- Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> Signed-off-by: 0x009922 <a.marcius26@gmail.com> Co-authored-by: Ilia Churin <churin.ilya@gmail.com>
There are bugs and other tasks as separated issues, but this issue might be closed, I think. upd: so we can close it only after verification, I see.. |
We also need to merge #3610 |
#3603 - @0x009922 close with comment |
After some research and discussions, I came up with the following thoughts. Decision to abandon Directory ModeCurrently, Developing Directory Mode turned out to be an exercise in futility. Its purpose was to generate a self-contained directory with peers configuration included, offering several options for the Docker image source:
This approach led to some ambiguities, primarily related to the peers configuration. For instance:
These questions have resulted in overcomplicated code and bugs. More importantly, there is no current use case for Directory Mode. Therefore, I propose to drop Directory Mode functionality and retain only File Mode. File Mode offers a more straightforward approach, free from the dependencies and complexities of Directory Mode. It is also used in the repo to generate sample Docker Compose configurations and is integrated into CI. Transitioning to a separate binary1Although File Mode (i.e.,
Example usageThe usage of iroha_swarm \
--build . \
--peers 5 \
--seed iroha \
--config-dir ./configs/peer \
--outfile docker-compose.dev.yml Footnotes
|
* [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>
* [refactor]: bump `clap`, scaffold `swarm` subcommand Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: transform `algorithm` to `ValueEnum` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [feature]: implement basic flow Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: clear dead code Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: safer paths manipulations Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: sort generated services Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [test]: update snapshot Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: skip empty command serialisation; chores Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: define consts Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: pass workspace check; lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: chores Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [feat]: impl basic UI Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: fix shallow git clone Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: update ui Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: simplify resolution reporting Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: doc comments, naming, etc Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: move `swarm` mod Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: chores; update doc comments Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: fix config path in docker image Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: clippy lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: specify all trusted peers; set genesis key pair only for the genesis peer Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: add fixme Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: chores Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [test]: fix `kagami` and `iroha_config_base` tests Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [fix]: use `SocketAddr` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: apply lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: allow any docker image; rename args Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: fix lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * Apply suggestions from code review Co-authored-by: Ilia Churin <churin.ilya@gmail.com> Signed-off-by: 0x009922 <a.marcius26@gmail.com> * [chore]: remove extra doc Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: remove inaccurate comment Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: use `.dir()` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: derive `Display` for `AlgorithmArg` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: use `Error::FieldDeserialization` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: apply lints Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: move secp256k1 seed len check to `iroha_crypto` Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [refactor]: expand `swarm::key_gen` module Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: fix format Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> * [chore]: capitalise error messages Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> --------- Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com> Signed-off-by: 0x009922 <a.marcius26@gmail.com> Co-authored-by: Ilia Churin <churin.ilya@gmail.com>
* [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>
The Iroha swarm tool allows generating
docker-compose.yml
files for specific numbers of peers.Having such a tool would be useful for @Mingela and the DevOps team.
Issues/PRs that must be solved in order to close this issue:
cargo install
#3603account_public_key
to the configuration" when trying to build docker compose generated Docker image #3605iroha2-dev
branch, it should not be a part of this issue.kagami validator
runnable from outsideiroha
dir #3610validator
andswarm
from Kagami #3833The text was updated successfully, but these errors were encountered: