This commit adds default values to CLI helper and docs. When the default value of a string flag, slice string flag, or map string flag is empty, its helper message won't show any default value.
* added a toml configuration file with comments describing each flag
* internal/cli/server: update flag description
* docs/cli: update example config and description of flags
* docs: update new-cli docs
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
* Added script to generate config.toml fromstart.sh (#518)
* added go and bash script to get config out of start.sh and updated flagset.go
* changed 'requiredblocks' flag back to 'eth.requiredblocks'
* updated script
* changed 'requiredblocks' flag back to 'eth.requiredblocks'
* updated tests, and removed requiredblocks from json and hcl
* addressed comments
* internal/cli/server: fix flag behaviour (#529)
* remove setting maxpeers to 0 for nodiscover flag
* set default prometheus and open-collector endpoint
* skip building grpc address from pprof address and port
* fix: linters
* fix and improve tests
* use loopback address for prometheus and open-collector endpoint
* add logs for prometheus and open-collector setup
* updated the script to handle prometheus-addr
* updated builder/files/config.toml
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
* 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 change will fix two issues:
1. When CLI sets a flag to an empty value in Go, e.g. 0 as to Uint64, the flag will be skipped and never set correctly. This problem could be solved by using option "WithOverwriteWithEmptyValue" when merge two configs.
2. The default non-empty value in server config will be overwritten to an empty value after flag initialization. This problem is solved by explicitly providing default value to all flags that have a default value option.
Adding a script that can automatically generate markdown pages from bor
CLI, so we can avoid copy-pasting helper strings whenever a flag is created,
deleted, or modified.
CLI docs could be generated with command `make docs`.