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

Make the config.toml file more modular by expanding env vars inside it #3946

Closed
trader-payne opened this issue Sep 16, 2022 · 5 comments · Fixed by #3974
Closed

Make the config.toml file more modular by expanding env vars inside it #3946

trader-payne opened this issue Sep 16, 2022 · 5 comments · Fixed by #3974
Assignees

Comments

@trader-payne
Copy link

Do you want to request a feature or report a bug?
Feature request

What is the current behavior?
Only some of the parameters can be inserted via env vars

What is the expected behavior?
Similar to b82ac37 but for pretty much anything there is to set inside the toml file.

Example:

[chains.${CHAIN_0}]
shard = "${SHARD_0}"
provider = [ { label = "${CHAIN_0}", url = "${CHAIN_RPC_0}", features = ["${CHAIN_0_FEATURES}"] } ]```
@neysofu
Copy link
Member

neysofu commented Sep 19, 2022

There's several production-ready tools that perform variable expansion:

I'd be inclined towards using of of these tools, rather than keep reinventing the wheel inside graph-node. Can you please check if they fit your use case and report back? Thanks 😃

E.g. go install https://github.com/a8m/envsubst/cmd/envsubst@latest && envsubst < graph-node-config.toml.template > graph-node-config.toml.

@neysofu
Copy link
Member

neysofu commented Sep 19, 2022

We're thinking about adding envsubst to the official graph-node Docker image, which would hopefully fix this problem for most use cases.

@trader-payne
Copy link
Author

I've tested it on the host machine and it works wonders! I would love to have this handed off to the graphnode container tho!

@trader-payne
Copy link
Author

I managed to integrate this into my Testnet Environment completely hands off, but again, this would be so much better to have in the graph-node container 🙏🏻 I think you can close this issue if you want, or keep it open until/if it's ever integrated 😬 Thanks a lot! You saved a lot of headaches during the MIPs program ser lol

@neysofu
Copy link
Member

neysofu commented Sep 21, 2022

I'll keep this open, hopefully we can get this sorted in time for 0.29.0 :)

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 a pull request may close this issue.

3 participants