internal/cli: use config file for flags in new-cli, builder/files: update defaults#457
Merged
Conversation
JekaMas
approved these changes
Jul 19, 2022
…from dumpconfig, setting up default values to the Raw fields in dumpconfig, and fixed one lint error
… file supported) and updated the merge logic in command.go -> Run()
Codecov Report
@@ Coverage Diff @@
## develop #457 +/- ##
===========================================
+ Coverage 56.30% 56.96% +0.66%
===========================================
Files 603 607 +4
Lines 69529 69899 +370
===========================================
+ Hits 39149 39820 +671
+ Misses 27012 26684 -328
- Partials 3368 3395 +27
Continue to review full report at Codecov.
|
cffls
reviewed
Jul 25, 2022
JekaMas
approved these changes
Jul 26, 2022
cffls
pushed a commit
to cffls/bor
that referenced
this pull request
Jul 30, 2022
…date defaults (0xPolygon#457) * updated simple.json and simple.hcl * added annotations for developer and grpc block * added toml tags and simple.toml file * added support for toml config files * updated simple files toml, hcl, json * added config.toml in builder/files and updated bor.service * add dumpconfig command in cli for exporting configs * update docs * updated .goreleaser.yml (POS-651) * changed --config to -config * added test config for tests and fixed lint errors * made fields of type big.int and time.Duration private, removed merge from dumpconfig, setting up default values to the Raw fields in dumpconfig, and fixed one lint error * fixed lint errors (strange) * lint fix * private no-more, using '-' in name tags to ignore * updated name tags, made c.configFile as a stringFlag (only one config file supported) and updated the merge logic in command.go -> Run() * fix: set method for big.Int flags, added a TODO * handeled bigInt and timeDuration type, bug fix in config_legacy, lint fix * updated flags, consistent across flags.go and config.go * fixed config test and updated test hcl, json config files * updated config legacy test * added test to check values of cmd flags, restructured Run in command.go, linter fix * fix linters * lint again * changed 2 flags and assert -> require * changed the 2 flags back * updated correct congig.toml path and made mainnet default * updated config.toml with new flags * added sample config (toml) file * removed sample-config.toml and added it in docs/config.md Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
cffls
pushed a commit
that referenced
this pull request
Aug 1, 2022
…date defaults (#457) * updated simple.json and simple.hcl * added annotations for developer and grpc block * added toml tags and simple.toml file * added support for toml config files * updated simple files toml, hcl, json * added config.toml in builder/files and updated bor.service * add dumpconfig command in cli for exporting configs * update docs * updated .goreleaser.yml (POS-651) * changed --config to -config * added test config for tests and fixed lint errors * made fields of type big.int and time.Duration private, removed merge from dumpconfig, setting up default values to the Raw fields in dumpconfig, and fixed one lint error * fixed lint errors (strange) * lint fix * private no-more, using '-' in name tags to ignore * updated name tags, made c.configFile as a stringFlag (only one config file supported) and updated the merge logic in command.go -> Run() * fix: set method for big.Int flags, added a TODO * handeled bigInt and timeDuration type, bug fix in config_legacy, lint fix * updated flags, consistent across flags.go and config.go * fixed config test and updated test hcl, json config files * updated config legacy test * added test to check values of cmd flags, restructured Run in command.go, linter fix * fix linters * lint again * changed 2 flags and assert -> require * changed the 2 flags back * updated correct congig.toml path and made mainnet default * updated config.toml with new flags * added sample config (toml) file * removed sample-config.toml and added it in docs/config.md Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does the following changes
dumpconfigwhich exports the flags provided to it while running in a toml format (for now). This commands works in the exact same way as in geth. Usage:bor dumpconfig <flags>.command.go, and restructured theRun()function by creating a new function to extract values from the argument.TODO's before merging
*big.Inttype fields (MaxPrice,IgnorePrice, andGasPrice), and have a look attime.Durationtype fields (TxPool.LifeTime,TxPool.Rejournal, andCache.Rejournal) (It's working fine, but we still need to handle thedumpconfigoutput)Jira tickets:
POS-586: Move flags from CLI to config file
POS-651: Provide a default config file
POS-635: Add dumpconfig in bor