-
Notifications
You must be signed in to change notification settings - Fork 167
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
cmd: Add config file support #2137
Conversation
Just to be super clear here - if flags are defined, they'll override the config? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just one minor question related to a comment.
I also think it would be great to add a short guide for configuring livepeer
using a config file in https://github.com/livepeer/livepeer-org/tree/master (the repo for https://livepeer.org/docs). Maybe a section called "Configuring Livepeer" under the "Installation" header...
Also, just want to confirm my understanding of the ff
package:
Since the package will parse flags, env vars and the config file the following should be true right?
- If
-maxGasPrice
is specified in all three, the value used in the flag takes precedence - If
-maxGasPrice
is not specified in flags, but other flags are specified and the config file specifies-maxGasPrice
then the value from the config file will be used
EDIT: Regarding the above question - just read your testing steps! 😓
Yes, they'll override the config. |
Co-authored-by: Eli Mallon <[email protected]>
Yes, working on this together with @hthillman in the branch
Yeah, it works exactly as you described. One more thing is that after the comment from @iameli , we added the env variables. So the priority here is (from the highest):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The ability to use env vars for config is a bonus - nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What does this pull request do? Explain your changes. (required)
Add a possibility to configure Livepeer using a config file instead of flags.
Sample usage:
Sample
livepeer.conf
Specific updates (required)
Used the library https://github.com/peterbourgon/ff, which allows using config file for the flags.
How did you test each of these updates (required)
Does this pull request close any open issues?
fix #101
Checklist:
make
runs successfully./test.sh
pass