lbcd/claimtrie/config/config.go
Roy Lee 424235655c [lbry] rework config and params
Ideally, network related params should be part of config, which is
passed down to the components to avoid references to global instances.

This commit is only halfway through as there are a couple of structs
that are too small to house the params and are still referencing
global variables. We'll rework that later.
2021-08-02 00:31:15 -07:00

56 lines
1.1 KiB
Go

package config
import (
"path/filepath"
"github.com/btcsuite/btcd/claimtrie/param"
"github.com/btcsuite/btcutil"
)
var DefaultConfig = Config{
Params: param.MainNet,
RamTrie: true, // as it stands the other trie uses more RAM, more time, and 40GB+ of disk space
DataDir: filepath.Join(btcutil.AppDataDir("chain", false), "data"),
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",
},
}
// Config is the container of all configurations.
type Config struct {
Params param.ClaimTrieParams
RamTrie bool
DataDir string
BlockRepoPebble pebbleConfig
NodeRepoPebble pebbleConfig
TemporalRepoPebble pebbleConfig
MerkleTrieRepoPebble pebbleConfig
ChainRepoPebble pebbleConfig
ReportedBlockRepoPebble pebbleConfig
}
type pebbleConfig struct {
Path string
}