Skip to content

Commit

Permalink
fix: db config (#68)
Browse files Browse the repository at this point in the history
- Fix db config mapping for `autocompactminage` and `dbtimeout`
- Add dbconfig to samples
  • Loading branch information
RafilxTenfen authored Sep 30, 2024
1 parent bfdac0f commit 9eb8b69
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
7 changes: 4 additions & 3 deletions config/dbconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package config

import (
"fmt"
"github.com/lightningnetwork/lnd/kvdb"
"time"

"github.com/lightningnetwork/lnd/kvdb"
)

const (
Expand Down Expand Up @@ -33,11 +34,11 @@ type DBConfig struct {
// 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 `mapstructure:"autocompact"`
AutoCompactMinAge time.Duration `mapstructure:"autocompactminage"`

// DBTimeout specifies the timeout value to use when opening the wallet
// database.
DBTimeout time.Duration `mapstructure:"autocompact"`
DBTimeout time.Duration `mapstructure:"dbtimeout"`
}

func DefaultDBConfig() *DBConfig {
Expand Down
16 changes: 15 additions & 1 deletion sample-vigilante-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ submitter:
resubmit-fee-multiplier: 1
polling-interval-seconds: 60
resend-interval-seconds: 1800
dbconfig:
dbpath: /vigilante/
dbfilename: submitter.db
nofreelistsync: true
autocompact: false
autocompactminage: 168h
dbtimeout: 60s
reporter:
netparams: simnet
btc_cache_size: 1000
Expand All @@ -69,4 +76,11 @@ monitor:
max-live-btc-heights: 200
enable-liveness-checker: true
enable-slasher: true
btcnetparams: simnet
btcnetparams: simnet
dbconfig:
dbpath: /vigilante/
dbfilename: monitor.db
nofreelistsync: true
autocompact: false
autocompactminage: 168h
dbtimeout: 60s
14 changes: 14 additions & 0 deletions sample-vigilante.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ submitter:
resubmit-fee-multiplier: 1
polling-interval-seconds: 60
resend-interval-seconds: 1800
dbconfig:
dbpath: $TESTNET_PATH/vigilante/
dbfilename: submitter.db
nofreelistsync: true
autocompact: false
autocompactminage: 168h
dbtimeout: 60s
reporter:
netparams: simnet
btc_cache_size: 1000
Expand All @@ -69,6 +76,13 @@ monitor:
enable-liveness-checker: true
enable-slasher: true
btcnetparams: simnet
dbconfig:
dbpath: $TESTNET_PATH/monitor/
dbfilename: submitter.db
nofreelistsync: true
autocompact: false
autocompactminage: 168h
dbtimeout: 60s
btcstaking-tracker:
check-delegations-interval: 1m
delegations-batch-size: 100
Expand Down

0 comments on commit 9eb8b69

Please sign in to comment.