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

miden-tx-prover configurations through env vars #1026

Closed
SantiagoPittella opened this issue Dec 18, 2024 · 2 comments
Closed

miden-tx-prover configurations through env vars #1026

SantiagoPittella opened this issue Dec 18, 2024 · 2 comments
Assignees
Milestone

Comments

@SantiagoPittella
Copy link
Collaborator

What should be done?

The miden-tx-prover CLI includes two services: worker (prover) and proxy. The worker receives through the CLI command the port in which will run. The proxy is a bit more complex, using a configuration file AND parameters from the CLI command.

Maybe the best option is to standardize this and remove the configuration file, and make command's argument "compatible" with env vars (using clap's env feature) as @Mirko-von-Leipzig suggested.

How should it be done?

  • We need to remove the init command and the configuration file.
  • Add the env feature for clap.
  • Add the configurable fields to the corresponding command.
  • Create an .env.example file with the default values.

In this issue we can also tackle the addition of trace_sampling_ratio (as mentioned here) and OTEL_EXPORTER_OTLP_ENDPOINT to the configurations.

When is this task done?

Additional context

No response

@Mirko-von-Leipzig
Copy link
Contributor

What's the reasoning behind the .env.example file?

Defaults can be assigned in the clap structs/derives. --help also outputs both the default values as well as the environment variables for them.

@bobbinth bobbinth added this to the v0.8 milestone Jan 21, 2025
@SantiagoPittella
Copy link
Collaborator Author

I was checking clap's features, and saw the env feature. This should make it work out of the box:

    #[arg(long, env = "HOST")] // Use `HOST` env var if `--host` is not provided
    host: String,

There's no need for an .env.example file since the toml from the init command will keep working.
I'm adding it.

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

No branches or pull requests

3 participants