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 : provider config file #320

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

undercover-cactus
Copy link
Contributor

In this PR, we add the possibility to specify a provider config file by using the argument --provider-config-file=./config.toml.

Expected behaviors when a provider config file is specified :

  • we check that the config file exists if it doesn't we print a message and return None as provider options.
  • we try to pass the file as a Toml file and make sure we have the required values.
  • --provider-config-file agrument cannot be used with any others of the provider configurations argument. The CLI will throw an error. It will avoid any conflict between the parameters and make sure the provider configurations are explicit.

Error message example :

error: the argument '--provider-type <PROVIDER_TYPE>' cannot be used with '--provider-config-file <PROVIDER_CONFIG_FILE>'

Usage: storage-hub-node --provider-type <PROVIDER_TYPE> [-- <RELAY_CHAIN_ARGS>...]

For more information, try '--help'.

Error message example in case of missing parameters in config file :

Fail to parse config file : TOML parse error at line 13, column 1
   |
13 | [provider]
   | ^^^^^^^^^^
missing field `extrinsic_retry_timeout`

@undercover-cactus undercover-cactus requested review from ffarall and a team January 10, 2025 12:59
@ffarall ffarall marked this pull request as ready for review January 11, 2025 01:09
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.

1 participant