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 config-out cli option #394

Merged
merged 1 commit into from
Nov 20, 2024
Merged

feat: adds config-out cli option #394

merged 1 commit into from
Nov 20, 2024

Conversation

dutterbutter
Copy link
Collaborator

What 💻

  • Added a new CLI option --config-out to specify an output file for JSON configuration.
  • Introduced a config_out field in the TestNodeConfig struct to handle output file specification.
  • Updated configuration handling with new methods: as_json for JSON conversion and set_config_out for setting the output file.
  • Updated the print method in TestNodeConfig to write configuration to the specified JSON file if config_out is set.

Why ✋

  • Aligns with Anvil CLI options
  • To provide users with the ability to export configuration settings as a JSON file for easier debugging and external processing.

Evidence 📷

Usage examples:

  1. Exporting configuration during a fork command:

    ./target/release/era_test_node --config-out text.json fork --network mainnet
  2. Exporting configuration during a run command:

    ./target/release/era_test_node --config-out text.json run

Output:

  • A JSON file (text.json) is created with the current configuration details after execution.

@dutterbutter dutterbutter merged commit 5e17d02 into main Nov 20, 2024
10 checks passed
@dutterbutter dutterbutter deleted the db/add-config-out branch November 20, 2024 18:34
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