Tendermint需要配置一些属性的时候是在config.toml中配置的,刚开始没看明白toml配置文件是如何生效的,深入了解了一下做个记录。
原来tnedermint使用了viper(ˈvaɪpə(r),现在看到i都得确认下发什么音)开源项目,那么viper是什么呢
看下github的解释:https://github.com/spf13/viper
Viper is a complete configuration solution for Go applications including 12-Factor apps. It is designed to work within an application, and can handle all types of configuration needs and formats. It supports:
setting defaults
reading from JSON, TOML, YAML, HCL, and Java properties config files
live watching and re-reading of config files (optional)
reading from environment variables
reading from remote config systems (etcd or Consul), and watching changes
reading from command line flags
reading from buffer
setting explicit values
Viper can be thought of as a registry for all of your applications configuration needs.
(csdn改版了啊,这个框可以再编辑了