Skip to content

Support passing configs via env vars #4734

Open
@karalabe

Description

@karalabe

We've just introduced a nifty feature into Geth where you can specify configurations in env vars too, not only cli flags. Each flag is mapped to an env var automatically, so it's fairly obvious and easy to understand.

E.g. --state.scheme would be GETH_STATE_SCHEME

Wondering if Lighthouse has a similar feature planned?

The benefit of this is that in many cloud or container provider settings, the usual way to configure stuff is via env vars. Most providers allow you to define env vars in templates, add defaults, docs, etc to them, making these templates easy to redistribute and even check for issues. Although they usually also support passing CLI flags, that's just one mega-mess of a single string containing everything, so it's very brittle.

My assumption is that whatever CLI library you're using already has support for env vars, you just need to tell them which var is mapped to which flag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions