2021-07-06 18:39:56 -07:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
2021-07-12 16:08:47 -07:00
|
|
|
|
|
|
|
"github.com/btcsuite/btcutil"
|
2021-07-06 18:39:56 -07:00
|
|
|
)
|
|
|
|
|
2021-07-12 16:08:47 -07:00
|
|
|
var DefaultConfig = Config{
|
|
|
|
Record: false,
|
|
|
|
RamTrie: false,
|
|
|
|
|
|
|
|
DataDir: filepath.Join(btcutil.AppDataDir("chain", false), "data", "mainnet", "claim_dbs"),
|
|
|
|
|
|
|
|
BlockRepoPebble: pebbleConfig{
|
|
|
|
Path: "blocks_pebble_db",
|
|
|
|
},
|
|
|
|
NodeRepoPebble: pebbleConfig{
|
|
|
|
Path: "node_change_pebble_db",
|
|
|
|
},
|
|
|
|
TemporalRepoPebble: pebbleConfig{
|
|
|
|
Path: "temporal_pebble_db",
|
|
|
|
},
|
|
|
|
MerkleTrieRepoPebble: pebbleConfig{
|
|
|
|
Path: "merkletrie_pebble_db",
|
|
|
|
},
|
|
|
|
ChainRepoPebble: pebbleConfig{
|
|
|
|
Path: "chain_pebble_db",
|
|
|
|
},
|
|
|
|
ReportedBlockRepoPebble: pebbleConfig{
|
|
|
|
Path: "reported_blocks_pebble_db",
|
|
|
|
},
|
2021-07-06 18:39:56 -07:00
|
|
|
}
|
|
|
|
|
2021-07-12 16:08:47 -07:00
|
|
|
// Config is the container of all configurations.
|
|
|
|
type Config struct {
|
|
|
|
Record bool
|
|
|
|
RamTrie bool
|
|
|
|
|
|
|
|
DataDir string
|
|
|
|
|
2021-07-06 18:39:56 -07:00
|
|
|
BlockRepoPebble pebbleConfig
|
|
|
|
NodeRepoPebble pebbleConfig
|
|
|
|
TemporalRepoPebble pebbleConfig
|
|
|
|
MerkleTrieRepoPebble pebbleConfig
|
|
|
|
|
|
|
|
ChainRepoPebble pebbleConfig
|
|
|
|
ReportedBlockRepoPebble pebbleConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
type pebbleConfig struct {
|
|
|
|
Path string
|
|
|
|
}
|