Skip to content
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

fix(config): fix db config meta fields #65

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions config/dbconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions config/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions config/submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading