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

feat: adds sidechain_main_cli into config file instead #64

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

falcucci
Copy link

@falcucci falcucci commented Aug 28, 2024

As we have the sidechain-main-cli binary as an external dependency, would be easier for developers/users to load its binary path from the partner-chains-cli-resources-config.json file so the user can have it installed in their PATH and update them only if needed but keeping the default one as ./sidechain-main-cli just in case.

- add a new constant `sidechain_main_cli_name` with value `sidechain-main-cli`
- change the assignment of `sidechain_main_cli_path` to include `{sidechain_main_cli_name}`
- update the `load_chain_config` function to load `sidechain_main_cli` from file
- add a new constant `sidechain_main_cli` with default value `sidechain_main_cli_path`
- add a new function `which` in the `iocontext` trait
- update the `defaultcmdruncontext` implementation of `iocontext` to include the `which` function
- add a new file `io.rs` with changes for `which` and its implementation in `defaultcmdruncontext`
- modify the `prepare_main_chain_config` function to use `sidechain_main_cli_name` instead of `sidechain_main_cli_path`
- update the `run_sidechain_main_cli_addresses` function to load `sidechain_main_cli` from file
- change the command in the `addresses_cmd` function to include `sidechain_cli_path`
- replace `sidechain_main_cli_path` with `sidechain_exec` in error messages and commands
- update the `sidechain_main_cli_version_cmd` to use `{sidechain_main_cli_path}`
- modify the `sidechain_main_cli_version_cmd` and `sidechain_main_cli_version_prompt` functions to use `sidechain_exec` instead of `sidechain_main_cli_path`
@falcucci falcucci changed the title feat: update the load_chain_config function to load sidechain_main_cli from config file instead feat: adds sidechain_main_cli into config file instead Aug 28, 2024
- remove the `println!` statement that logged the `sidechain_exec` variable
- add initialization for `sidechain_exec` variable
- adjust the `command` format string by removing `{sidechain_main_cli_path}`
- update the format string with `{}` instead of `{sidechain_main_cli_path}`
- update the `config_fields::sidechain_main_cli` loading process
- add loading of sidechain cli executable from configuration file
- update command format to include sidechain cli executable
- fix a typo in the error message text
- adjust line numbers in the set_d_parameter_on_main_chain function
…i key

- remove `sidechain_main_cli_name` constant
- update `sidechain_main_cli_path` constant definition
- adjust calls to `sidechain_main_cli_version_prompt` function to include `sidechain_main_cli_path`
- add `sidechain_main_cli` key to resource config content
- edit resource config content to include `sidechain_main_cli` key
- update `mockio::print` call to include multiple items
- edit resource config content to include `sidechain_main_cli` key
- add `sidechain_main_cli` key to resource config content
- edit resource config content to include `sidechain_main_cli` key
- implement `which` method in `iocontext`
- adjust `promptyn` mock action in `iocontext` for `mockiocontext`
- update error messages in multiple functions for missing partner chains smart contracts executable file
- remove loading of sidechain executable in `prepare_main_chain_config`
- consolidate error message generation for missing sidechain executable in multiple functions
- add `debug` trait implementation for `mockiocontext` struct
@LGLO
Copy link
Contributor

LGLO commented Aug 30, 2024

@falcucci Thank you for your contribution!

Having the path to smart-contracts CLI (sorry for the current cryptic name) hardcoded in partner-chains-cli tool was a decision, it was not just because it is easier to implement. The biggest factor to make this decision was to make it hard to use versions of sidechain-main-cli that are incompatible with partner-chains-cli. Please give us some time to revisit this decision.

@falcucci
Copy link
Author

falcucci commented Aug 30, 2024

@LGLO hey, thank you for the explanation.

that's fine this is a take it or leave it change, once I am using for personal purposes during development part of the walk-through setup of the partner-chain.

Anyway I'll keep this up to date with the upstream changes, so in case the decision changes that's ready and available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants