diff --git a/config/dbconfig.go b/config/dbconfig.go index fc6dc54..ec98aec 100644 --- a/config/dbconfig.go +++ b/config/dbconfig.go @@ -13,31 +13,31 @@ const ( type DBConfig struct { // DBPath is the directory path in which the database file should be // stored. - DBPath string `long:"dbpath" description:"The directory path in which the database file should be stored."` + DBPath string `mapstructure:"dbpath"` // DBFileName is the name of the database file. - DBFileName string `long:"dbfilename" description:"The name of the database file."` + DBFileName string `mapstructure:"dbfilename"` // NoFreelistSync, if true, prevents the database from syncing its // freelist to disk, resulting in improved performance at the expense of // increased startup time. - NoFreelistSync bool `long:"nofreelistsync" description:"Prevents the database from syncing its freelist to disk, resulting in improved performance at the expense of increased startup time."` + NoFreelistSync bool `mapstructure:"nofreelistsync"` // AutoCompact specifies if a Bolt based database backend should be // automatically compacted on startup (if the minimum age of the // database file is reached). This will require additional disk space // for the compacted copy of the database but will result in an overall // lower database size after the compaction. - AutoCompact bool `long:"autocompact" description:"Specifies if a Bolt based database backend should be automatically compacted on startup (if the minimum age of the database file is reached). This will require additional disk space for the compacted copy of the database but will result in an overall lower database size after the compaction."` + AutoCompact bool `mapstructure:"autocompact"` // AutoCompactMinAge specifies the minimum time that must have passed // since a bolt database file was last compacted for the compaction to // be considered again. - AutoCompactMinAge time.Duration `long:"autocompactminage" description:"Specifies the minimum time that must have passed since a bolt database file was last compacted for the compaction to be considered again."` + AutoCompactMinAge time.Duration `mapstructure:"autocompact"` // DBTimeout specifies the timeout value to use when opening the wallet // database. - DBTimeout time.Duration `long:"dbtimeout" description:"Specifies the timeout value to use when opening the wallet database."` + DBTimeout time.Duration `mapstructure:"autocompact"` } func DefaultDBConfig() *DBConfig { diff --git a/config/monitor.go b/config/monitor.go index 9653141..aace1b7 100644 --- a/config/monitor.go +++ b/config/monitor.go @@ -29,8 +29,8 @@ type MonitorConfig struct { BtcConfirmationDepth uint64 `mapstructure:"btc-confirmation-depth"` // whether to enable liveness checker EnableLivenessChecker bool `mapstructure:"enable-liveness-checker"` - - DatabaseConfig *DBConfig `mapstructure:"database-config"` + // DatabaseConfig stores lates epoch and height used for faster bootstrap + DatabaseConfig *DBConfig `mapstructure:"dbconfig"` } func (cfg *MonitorConfig) Validate() error { diff --git a/config/submitter.go b/config/submitter.go index 511deee..6a7b6d8 100644 --- a/config/submitter.go +++ b/config/submitter.go @@ -25,8 +25,9 @@ type SubmitterConfig struct { PollingIntervalSeconds uint `mapstructure:"polling-interval-seconds"` // ResendIntervalSeconds defines the time (in seconds) which the submitter awaits // before resubmitting checkpoints to BTC - ResendIntervalSeconds uint `mapstructure:"resend-interval-seconds"` - DatabaseConfig *DBConfig `mapstructure:"database-config"` + ResendIntervalSeconds uint `mapstructure:"resend-interval-seconds"` + // DatabaseConfig stores last submitted txn + DatabaseConfig *DBConfig `mapstructure:"dbconfig"` } func (cfg *SubmitterConfig) Validate() error {