aboutsummaryrefslogtreecommitdiffstats
path: root/eth/config.go
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2017-11-24 22:10:27 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-11-24 22:10:27 +0800
commitf14047dae57aa69e4fa08d57e19ee9c0283dfa54 (patch)
treeb1b9523a4ce12e2b3cc472bdcf38df7ddbd4bdcc /eth/config.go
parentb0056f5bd096adf42a2c28cd76264f230c7cae20 (diff)
downloaddexon-f14047dae57aa69e4fa08d57e19ee9c0283dfa54.tar.gz
dexon-f14047dae57aa69e4fa08d57e19ee9c0283dfa54.tar.zst
dexon-f14047dae57aa69e4fa08d57e19ee9c0283dfa54.zip
cmd, consensus, eth: split ethash related config to it own (#15520)
* cmd, consensus, eth: split ethash related config to it own * eth, consensus: minor polish * eth, consenus, console: compress pow testing config field to single one * consensus, eth: document pow mode
Diffstat (limited to 'eth/config.go')
-rw-r--r--eth/config.go39
1 files changed, 17 insertions, 22 deletions
diff --git a/eth/config.go b/eth/config.go
index 7bcfd403e..383cd6783 100644
--- a/eth/config.go
+++ b/eth/config.go
@@ -25,6 +25,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
+ "github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/gasprice"
@@ -33,16 +34,18 @@ import (
// DefaultConfig contains default settings for use on the Ethereum main net.
var DefaultConfig = Config{
- SyncMode: downloader.FastSync,
- EthashCacheDir: "ethash",
- EthashCachesInMem: 2,
- EthashCachesOnDisk: 3,
- EthashDatasetsInMem: 1,
- EthashDatasetsOnDisk: 2,
- NetworkId: 1,
- LightPeers: 20,
- DatabaseCache: 128,
- GasPrice: big.NewInt(18 * params.Shannon),
+ SyncMode: downloader.FastSync,
+ Ethash: ethash.Config{
+ CacheDir: "ethash",
+ CachesInMem: 2,
+ CachesOnDisk: 3,
+ DatasetsInMem: 1,
+ DatasetsOnDisk: 2,
+ },
+ NetworkId: 1,
+ LightPeers: 20,
+ DatabaseCache: 128,
+ GasPrice: big.NewInt(18 * params.Shannon),
TxPool: core.DefaultTxPoolConfig,
GPO: gasprice.Config{
@@ -59,9 +62,9 @@ func init() {
}
}
if runtime.GOOS == "windows" {
- DefaultConfig.EthashDatasetDir = filepath.Join(home, "AppData", "Ethash")
+ DefaultConfig.Ethash.DatasetDir = filepath.Join(home, "AppData", "Ethash")
} else {
- DefaultConfig.EthashDatasetDir = filepath.Join(home, ".ethash")
+ DefaultConfig.Ethash.DatasetDir = filepath.Join(home, ".ethash")
}
}
@@ -92,12 +95,7 @@ type Config struct {
GasPrice *big.Int
// Ethash options
- EthashCacheDir string
- EthashCachesInMem int
- EthashCachesOnDisk int
- EthashDatasetDir string
- EthashDatasetsInMem int
- EthashDatasetsOnDisk int
+ Ethash ethash.Config
// Transaction pool options
TxPool core.TxPoolConfig
@@ -109,10 +107,7 @@ type Config struct {
EnablePreimageRecording bool
// Miscellaneous options
- DocRoot string `toml:"-"`
- PowFake bool `toml:"-"`
- PowTest bool `toml:"-"`
- PowShared bool `toml:"-"`
+ DocRoot string `toml:"-"`
}
type configMarshaling struct {