move Blockstore config to FullNode, rename to Chainstore and add default for HotStoreType

This commit is contained in:
vyzo
2021-03-05 14:46:18 +02:00
parent 6014273e69
commit dd0c308427
3 changed files with 20 additions and 22 deletions
+15 -17
View File
@@ -12,19 +12,19 @@ import (
// Common is common config between full node and miner
type Common struct {
API API
Libp2p Libp2p
Pubsub Pubsub
Blockstore Blockstore
API API
Libp2p Libp2p
Pubsub Pubsub
}
// FullNode is a full node config
type FullNode struct {
Common
Client Client
Metrics Metrics
Wallet Wallet
Fees FeeConfig
Client Client
Metrics Metrics
Wallet Wallet
Fees FeeConfig
Chainstore Chainstore
}
// // Common
@@ -120,7 +120,7 @@ type Pubsub struct {
RemoteTracer string
}
type Blockstore struct {
type Chainstore struct {
EnableSplitstore bool
Splitstore Splitstore
}
@@ -134,14 +134,6 @@ type Splitstore struct {
Archival bool
}
func (s *Splitstore) GetHotStoreType() string {
// default is badger
if s.HotStoreType == "" {
return "badger"
}
return s.HotStoreType
}
// // Full Node
type Metrics struct {
@@ -207,6 +199,12 @@ func DefaultFullNode() *FullNode {
Client: Client{
SimultaneousTransfers: DefaultSimultaneousTransfers,
},
Chainstore: Chainstore{
EnableSplitstore: false,
Splitstore: Splitstore{
HotStoreType: "badger",
},
},
}
}