forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.go
45 lines (34 loc) · 2.28 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package kvdb
import "time"
const (
// BoltBackendName is the name of the backend that should be passed into
// kvdb.Create to initialize a new instance of kvdb.Backend backed by a
// live instance of bbolt.
BoltBackendName = "bdb"
// EtcdBackendName is the name of the backend that should be passed into
// kvdb.Create to initialize a new instance of kvdb.Backend backed by a
// live instance of etcd.
EtcdBackendName = "etcd"
// PostgresBackendName is the name of the backend that should be passed
// into kvdb.Create to initialize a new instance of kvdb.Backend backed
// by a live instance of postgres.
PostgresBackendName = "postgres"
// SqliteBackendName is the name of the backend that should be passed
// into kvdb.Create to initialize a new instance of kvdb.Backend backed
// by a live instance of sqlite.
SqliteBackendName = "sqlite"
// DefaultBoltAutoCompactMinAge is the default minimum time that must
// have passed since a bolt database file was last compacted for the
// compaction to be considered again.
DefaultBoltAutoCompactMinAge = time.Hour * 24 * 7
// DefaultDBTimeout specifies the default timeout value when opening
// the bbolt database.
DefaultDBTimeout = time.Second * 60
)
// BoltConfig holds bolt configuration.
type BoltConfig struct {
NoFreelistSync bool `long:"nofreelistsync" description:"Whether the databases used within lnd should sync their freelist to disk. This is set to true by default, meaning we don't sync the free-list resulting in imporved memory performance during operation, but with an increase in startup time."`
AutoCompact bool `long:"auto-compact" description:"Whether the databases used within lnd should automatically be compacted on every startup (and if the database has the configured minimum age). This is disabled by default because it requires additional disk space to be available during the compaction that is freed afterwards. In general compaction leads to smaller database files."`
AutoCompactMinAge time.Duration `long:"auto-compact-min-age" description:"How long ago the last compaction of a database file must be for it to be considered for auto compaction again. Can be set to 0 to compact on every startup."`
DBTimeout time.Duration `long:"dbtimeout" description:"Specify the timeout value used when opening the database."`
}