@ -44,6 +44,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/eth/gasprice"
"github.com/ethereum/go-ethereum/eth/gasprice"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethdb"
@ -137,7 +138,7 @@ var (
NetworkIdFlag = cli . Uint64Flag {
NetworkIdFlag = cli . Uint64Flag {
Name : "networkid" ,
Name : "networkid" ,
Usage : "Explicitly set network id (integer)(For testnets: use --ropsten, --rinkeby, --goerli instead)" ,
Usage : "Explicitly set network id (integer)(For testnets: use --ropsten, --rinkeby, --goerli instead)" ,
Value : eth . DefaultConfig . NetworkId ,
Value : ethconfig . Defaults . NetworkId ,
}
}
MainnetFlag = cli . BoolFlag {
MainnetFlag = cli . BoolFlag {
Name : "mainnet" ,
Name : "mainnet" ,
@ -196,7 +197,7 @@ var (
Name : "nocode" ,
Name : "nocode" ,
Usage : "Exclude contract code (save db lookups)" ,
Usage : "Exclude contract code (save db lookups)" ,
}
}
defaultSyncMode = eth . DefaultConfig . SyncMode
defaultSyncMode = ethconfig . Defaults . SyncMode
SyncModeFlag = TextMarshalerFlag {
SyncModeFlag = TextMarshalerFlag {
Name : "syncmode" ,
Name : "syncmode" ,
Usage : ` Blockchain sync mode ("fast", "full", "snap" or "light") ` ,
Usage : ` Blockchain sync mode ("fast", "full", "snap" or "light") ` ,
@ -228,32 +229,32 @@ var (
LightServeFlag = cli . IntFlag {
LightServeFlag = cli . IntFlag {
Name : "light.serve" ,
Name : "light.serve" ,
Usage : "Maximum percentage of time allowed for serving LES requests (multi-threaded processing allows values over 100)" ,
Usage : "Maximum percentage of time allowed for serving LES requests (multi-threaded processing allows values over 100)" ,
Value : eth . DefaultConfig . LightServ ,
Value : ethconfig . Defaults . LightServ ,
}
}
LightIngressFlag = cli . IntFlag {
LightIngressFlag = cli . IntFlag {
Name : "light.ingress" ,
Name : "light.ingress" ,
Usage : "Incoming bandwidth limit for serving light clients (kilobytes/sec, 0 = unlimited)" ,
Usage : "Incoming bandwidth limit for serving light clients (kilobytes/sec, 0 = unlimited)" ,
Value : eth . DefaultConfig . LightIngress ,
Value : ethconfig . Defaults . LightIngress ,
}
}
LightEgressFlag = cli . IntFlag {
LightEgressFlag = cli . IntFlag {
Name : "light.egress" ,
Name : "light.egress" ,
Usage : "Outgoing bandwidth limit for serving light clients (kilobytes/sec, 0 = unlimited)" ,
Usage : "Outgoing bandwidth limit for serving light clients (kilobytes/sec, 0 = unlimited)" ,
Value : eth . DefaultConfig . LightEgress ,
Value : ethconfig . Defaults . LightEgress ,
}
}
LightMaxPeersFlag = cli . IntFlag {
LightMaxPeersFlag = cli . IntFlag {
Name : "light.maxpeers" ,
Name : "light.maxpeers" ,
Usage : "Maximum number of light clients to serve, or light servers to attach to" ,
Usage : "Maximum number of light clients to serve, or light servers to attach to" ,
Value : eth . DefaultConfig . LightPeers ,
Value : ethconfig . Defaults . LightPeers ,
}
}
UltraLightServersFlag = cli . StringFlag {
UltraLightServersFlag = cli . StringFlag {
Name : "ulc.servers" ,
Name : "ulc.servers" ,
Usage : "List of trusted ultra-light servers" ,
Usage : "List of trusted ultra-light servers" ,
Value : strings . Join ( eth . DefaultConfig . UltraLightServers , "," ) ,
Value : strings . Join ( ethconfig . Defaults . UltraLightServers , "," ) ,
}
}
UltraLightFractionFlag = cli . IntFlag {
UltraLightFractionFlag = cli . IntFlag {
Name : "ulc.fraction" ,
Name : "ulc.fraction" ,
Usage : "Minimum % of trusted ultra-light servers required to announce a new head" ,
Usage : "Minimum % of trusted ultra-light servers required to announce a new head" ,
Value : eth . DefaultConfig . UltraLightFraction ,
Value : ethconfig . Defaults . UltraLightFraction ,
}
}
UltraLightOnlyAnnounceFlag = cli . BoolFlag {
UltraLightOnlyAnnounceFlag = cli . BoolFlag {
Name : "ulc.onlyannounce" ,
Name : "ulc.onlyannounce" ,
@ -271,12 +272,12 @@ var (
EthashCachesInMemoryFlag = cli . IntFlag {
EthashCachesInMemoryFlag = cli . IntFlag {
Name : "ethash.cachesinmem" ,
Name : "ethash.cachesinmem" ,
Usage : "Number of recent ethash caches to keep in memory (16MB each)" ,
Usage : "Number of recent ethash caches to keep in memory (16MB each)" ,
Value : eth . DefaultConfig . Ethash . CachesInMem ,
Value : ethconfig . Defaults . Ethash . CachesInMem ,
}
}
EthashCachesOnDiskFlag = cli . IntFlag {
EthashCachesOnDiskFlag = cli . IntFlag {
Name : "ethash.cachesondisk" ,
Name : "ethash.cachesondisk" ,
Usage : "Number of recent ethash caches to keep on disk (16MB each)" ,
Usage : "Number of recent ethash caches to keep on disk (16MB each)" ,
Value : eth . DefaultConfig . Ethash . CachesOnDisk ,
Value : ethconfig . Defaults . Ethash . CachesOnDisk ,
}
}
EthashCachesLockMmapFlag = cli . BoolFlag {
EthashCachesLockMmapFlag = cli . BoolFlag {
Name : "ethash.cacheslockmmap" ,
Name : "ethash.cacheslockmmap" ,
@ -285,17 +286,17 @@ var (
EthashDatasetDirFlag = DirectoryFlag {
EthashDatasetDirFlag = DirectoryFlag {
Name : "ethash.dagdir" ,
Name : "ethash.dagdir" ,
Usage : "Directory to store the ethash mining DAGs" ,
Usage : "Directory to store the ethash mining DAGs" ,
Value : DirectoryString ( eth . DefaultConfig . Ethash . DatasetDir ) ,
Value : DirectoryString ( ethconfig . Defaults . Ethash . DatasetDir ) ,
}
}
EthashDatasetsInMemoryFlag = cli . IntFlag {
EthashDatasetsInMemoryFlag = cli . IntFlag {
Name : "ethash.dagsinmem" ,
Name : "ethash.dagsinmem" ,
Usage : "Number of recent ethash mining DAGs to keep in memory (1+GB each)" ,
Usage : "Number of recent ethash mining DAGs to keep in memory (1+GB each)" ,
Value : eth . DefaultConfig . Ethash . DatasetsInMem ,
Value : ethconfig . Defaults . Ethash . DatasetsInMem ,
}
}
EthashDatasetsOnDiskFlag = cli . IntFlag {
EthashDatasetsOnDiskFlag = cli . IntFlag {
Name : "ethash.dagsondisk" ,
Name : "ethash.dagsondisk" ,
Usage : "Number of recent ethash mining DAGs to keep on disk (1+GB each)" ,
Usage : "Number of recent ethash mining DAGs to keep on disk (1+GB each)" ,
Value : eth . DefaultConfig . Ethash . DatasetsOnDisk ,
Value : ethconfig . Defaults . Ethash . DatasetsOnDisk ,
}
}
EthashDatasetsLockMmapFlag = cli . BoolFlag {
EthashDatasetsLockMmapFlag = cli . BoolFlag {
Name : "ethash.dagslockmmap" ,
Name : "ethash.dagslockmmap" ,
@ -323,37 +324,37 @@ var (
TxPoolPriceLimitFlag = cli . Uint64Flag {
TxPoolPriceLimitFlag = cli . Uint64Flag {
Name : "txpool.pricelimit" ,
Name : "txpool.pricelimit" ,
Usage : "Minimum gas price limit to enforce for acceptance into the pool" ,
Usage : "Minimum gas price limit to enforce for acceptance into the pool" ,
Value : eth . DefaultConfig . TxPool . PriceLimit ,
Value : ethconfig . Defaults . TxPool . PriceLimit ,
}
}
TxPoolPriceBumpFlag = cli . Uint64Flag {
TxPoolPriceBumpFlag = cli . Uint64Flag {
Name : "txpool.pricebump" ,
Name : "txpool.pricebump" ,
Usage : "Price bump percentage to replace an already existing transaction" ,
Usage : "Price bump percentage to replace an already existing transaction" ,
Value : eth . DefaultConfig . TxPool . PriceBump ,
Value : ethconfig . Defaults . TxPool . PriceBump ,
}
}
TxPoolAccountSlotsFlag = cli . Uint64Flag {
TxPoolAccountSlotsFlag = cli . Uint64Flag {
Name : "txpool.accountslots" ,
Name : "txpool.accountslots" ,
Usage : "Minimum number of executable transaction slots guaranteed per account" ,
Usage : "Minimum number of executable transaction slots guaranteed per account" ,
Value : eth . DefaultConfig . TxPool . AccountSlots ,
Value : ethconfig . Defaults . TxPool . AccountSlots ,
}
}
TxPoolGlobalSlotsFlag = cli . Uint64Flag {
TxPoolGlobalSlotsFlag = cli . Uint64Flag {
Name : "txpool.globalslots" ,
Name : "txpool.globalslots" ,
Usage : "Maximum number of executable transaction slots for all accounts" ,
Usage : "Maximum number of executable transaction slots for all accounts" ,
Value : eth . DefaultConfig . TxPool . GlobalSlots ,
Value : ethconfig . Defaults . TxPool . GlobalSlots ,
}
}
TxPoolAccountQueueFlag = cli . Uint64Flag {
TxPoolAccountQueueFlag = cli . Uint64Flag {
Name : "txpool.accountqueue" ,
Name : "txpool.accountqueue" ,
Usage : "Maximum number of non-executable transaction slots permitted per account" ,
Usage : "Maximum number of non-executable transaction slots permitted per account" ,
Value : eth . DefaultConfig . TxPool . AccountQueue ,
Value : ethconfig . Defaults . TxPool . AccountQueue ,
}
}
TxPoolGlobalQueueFlag = cli . Uint64Flag {
TxPoolGlobalQueueFlag = cli . Uint64Flag {
Name : "txpool.globalqueue" ,
Name : "txpool.globalqueue" ,
Usage : "Maximum number of non-executable transaction slots for all accounts" ,
Usage : "Maximum number of non-executable transaction slots for all accounts" ,
Value : eth . DefaultConfig . TxPool . GlobalQueue ,
Value : ethconfig . Defaults . TxPool . GlobalQueue ,
}
}
TxPoolLifetimeFlag = cli . DurationFlag {
TxPoolLifetimeFlag = cli . DurationFlag {
Name : "txpool.lifetime" ,
Name : "txpool.lifetime" ,
Usage : "Maximum amount of time non-executable transaction are queued" ,
Usage : "Maximum amount of time non-executable transaction are queued" ,
Value : eth . DefaultConfig . TxPool . Lifetime ,
Value : ethconfig . Defaults . TxPool . Lifetime ,
}
}
// Performance tuning settings
// Performance tuning settings
CacheFlag = cli . IntFlag {
CacheFlag = cli . IntFlag {
@ -374,12 +375,12 @@ var (
CacheTrieJournalFlag = cli . StringFlag {
CacheTrieJournalFlag = cli . StringFlag {
Name : "cache.trie.journal" ,
Name : "cache.trie.journal" ,
Usage : "Disk journal directory for trie cache to survive node restarts" ,
Usage : "Disk journal directory for trie cache to survive node restarts" ,
Value : eth . DefaultConfig . TrieCleanCacheJournal ,
Value : ethconfig . Defaults . TrieCleanCacheJournal ,
}
}
CacheTrieRejournalFlag = cli . DurationFlag {
CacheTrieRejournalFlag = cli . DurationFlag {
Name : "cache.trie.rejournal" ,
Name : "cache.trie.rejournal" ,
Usage : "Time interval to regenerate the trie cache journal" ,
Usage : "Time interval to regenerate the trie cache journal" ,
Value : eth . DefaultConfig . TrieCleanCacheRejournal ,
Value : ethconfig . Defaults . TrieCleanCacheRejournal ,
}
}
CacheGCFlag = cli . IntFlag {
CacheGCFlag = cli . IntFlag {
Name : "cache.gc" ,
Name : "cache.gc" ,
@ -416,17 +417,17 @@ var (
MinerGasTargetFlag = cli . Uint64Flag {
MinerGasTargetFlag = cli . Uint64Flag {
Name : "miner.gastarget" ,
Name : "miner.gastarget" ,
Usage : "Target gas floor for mined blocks" ,
Usage : "Target gas floor for mined blocks" ,
Value : eth . DefaultConfig . Miner . GasFloor ,
Value : ethconfig . Defaults . Miner . GasFloor ,
}
}
MinerGasLimitFlag = cli . Uint64Flag {
MinerGasLimitFlag = cli . Uint64Flag {
Name : "miner.gaslimit" ,
Name : "miner.gaslimit" ,
Usage : "Target gas ceiling for mined blocks" ,
Usage : "Target gas ceiling for mined blocks" ,
Value : eth . DefaultConfig . Miner . GasCeil ,
Value : ethconfig . Defaults . Miner . GasCeil ,
}
}
MinerGasPriceFlag = BigFlag {
MinerGasPriceFlag = BigFlag {
Name : "miner.gasprice" ,
Name : "miner.gasprice" ,
Usage : "Minimum gas price for mining a transaction" ,
Usage : "Minimum gas price for mining a transaction" ,
Value : eth . DefaultConfig . Miner . GasPrice ,
Value : ethconfig . Defaults . Miner . GasPrice ,
}
}
MinerEtherbaseFlag = cli . StringFlag {
MinerEtherbaseFlag = cli . StringFlag {
Name : "miner.etherbase" ,
Name : "miner.etherbase" ,
@ -440,7 +441,7 @@ var (
MinerRecommitIntervalFlag = cli . DurationFlag {
MinerRecommitIntervalFlag = cli . DurationFlag {
Name : "miner.recommit" ,
Name : "miner.recommit" ,
Usage : "Time interval to recreate the block being mined" ,
Usage : "Time interval to recreate the block being mined" ,
Value : eth . DefaultConfig . Miner . Recommit ,
Value : ethconfig . Defaults . Miner . Recommit ,
}
}
MinerNoVerfiyFlag = cli . BoolFlag {
MinerNoVerfiyFlag = cli . BoolFlag {
Name : "miner.noverify" ,
Name : "miner.noverify" ,
@ -473,12 +474,12 @@ var (
RPCGlobalGasCapFlag = cli . Uint64Flag {
RPCGlobalGasCapFlag = cli . Uint64Flag {
Name : "rpc.gascap" ,
Name : "rpc.gascap" ,
Usage : "Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)" ,
Usage : "Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)" ,
Value : eth . DefaultConfig . RPCGasCap ,
Value : ethconfig . Defaults . RPCGasCap ,
}
}
RPCGlobalTxFeeCapFlag = cli . Float64Flag {
RPCGlobalTxFeeCapFlag = cli . Float64Flag {
Name : "rpc.txfeecap" ,
Name : "rpc.txfeecap" ,
Usage : "Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)" ,
Usage : "Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)" ,
Value : eth . DefaultConfig . RPCTxFeeCap ,
Value : ethconfig . Defaults . RPCTxFeeCap ,
}
}
// Logging and debug settings
// Logging and debug settings
EthStatsURLFlag = cli . StringFlag {
EthStatsURLFlag = cli . StringFlag {
@ -650,17 +651,17 @@ var (
GpoBlocksFlag = cli . IntFlag {
GpoBlocksFlag = cli . IntFlag {
Name : "gpo.blocks" ,
Name : "gpo.blocks" ,
Usage : "Number of recent blocks to check for gas prices" ,
Usage : "Number of recent blocks to check for gas prices" ,
Value : eth . DefaultConfig . GPO . Blocks ,
Value : ethconfig . Defaults . GPO . Blocks ,
}
}
GpoPercentileFlag = cli . IntFlag {
GpoPercentileFlag = cli . IntFlag {
Name : "gpo.percentile" ,
Name : "gpo.percentile" ,
Usage : "Suggested gas price is the given percentile of a set of recent transaction gas prices" ,
Usage : "Suggested gas price is the given percentile of a set of recent transaction gas prices" ,
Value : eth . DefaultConfig . GPO . Percentile ,
Value : ethconfig . Defaults . GPO . Percentile ,
}
}
GpoMaxGasPriceFlag = cli . Int64Flag {
GpoMaxGasPriceFlag = cli . Int64Flag {
Name : "gpo.maxprice" ,
Name : "gpo.maxprice" ,
Usage : "Maximum gas price will be recommended by gpo" ,
Usage : "Maximum gas price will be recommended by gpo" ,
Value : eth . DefaultConfig . GPO . MaxPrice . Int64 ( ) ,
Value : ethconfig . Defaults . GPO . MaxPrice . Int64 ( ) ,
}
}
WhisperEnabledFlag = cli . BoolFlag {
WhisperEnabledFlag = cli . BoolFlag {
Name : "shh" ,
Name : "shh" ,
@ -1028,7 +1029,7 @@ func setIPC(ctx *cli.Context, cfg *node.Config) {
}
}
// setLes configures the les server and ultra light client settings from the command line flags.
// setLes configures the les server and ultra light client settings from the command line flags.
func setLes ( ctx * cli . Context , cfg * eth . Config ) {
func setLes ( ctx * cli . Context , cfg * ethconfig . Config ) {
if ctx . GlobalIsSet ( LegacyLightServFlag . Name ) {
if ctx . GlobalIsSet ( LegacyLightServFlag . Name ) {
cfg . LightServ = ctx . GlobalInt ( LegacyLightServFlag . Name )
cfg . LightServ = ctx . GlobalInt ( LegacyLightServFlag . Name )
log . Warn ( "The flag --lightserv is deprecated and will be removed in the future, please use --light.serve" )
log . Warn ( "The flag --lightserv is deprecated and will be removed in the future, please use --light.serve" )
@ -1056,8 +1057,8 @@ func setLes(ctx *cli.Context, cfg *eth.Config) {
cfg . UltraLightFraction = ctx . GlobalInt ( UltraLightFractionFlag . Name )
cfg . UltraLightFraction = ctx . GlobalInt ( UltraLightFractionFlag . Name )
}
}
if cfg . UltraLightFraction <= 0 && cfg . UltraLightFraction > 100 {
if cfg . UltraLightFraction <= 0 && cfg . UltraLightFraction > 100 {
log . Error ( "Ultra light fraction is invalid" , "had" , cfg . UltraLightFraction , "updated" , eth . DefaultConfig . UltraLightFraction )
log . Error ( "Ultra light fraction is invalid" , "had" , cfg . UltraLightFraction , "updated" , ethconfig . Defaults . UltraLightFraction )
cfg . UltraLightFraction = eth . DefaultConfig . UltraLightFraction
cfg . UltraLightFraction = ethconfig . Defaults . UltraLightFraction
}
}
if ctx . GlobalIsSet ( UltraLightOnlyAnnounceFlag . Name ) {
if ctx . GlobalIsSet ( UltraLightOnlyAnnounceFlag . Name ) {
cfg . UltraLightOnlyAnnounce = ctx . GlobalBool ( UltraLightOnlyAnnounceFlag . Name )
cfg . UltraLightOnlyAnnounce = ctx . GlobalBool ( UltraLightOnlyAnnounceFlag . Name )
@ -1108,7 +1109,7 @@ func MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error
// setEtherbase retrieves the etherbase either from the directly specified
// setEtherbase retrieves the etherbase either from the directly specified
// command line flags or from the keystore if CLI indexed.
// command line flags or from the keystore if CLI indexed.
func setEtherbase ( ctx * cli . Context , ks * keystore . KeyStore , cfg * eth . Config ) {
func setEtherbase ( ctx * cli . Context , ks * keystore . KeyStore , cfg * ethconfig . Config ) {
// Extract the current etherbase, new flag overriding legacy one
// Extract the current etherbase, new flag overriding legacy one
var etherbase string
var etherbase string
if ctx . GlobalIsSet ( LegacyMinerEtherbaseFlag . Name ) {
if ctx . GlobalIsSet ( LegacyMinerEtherbaseFlag . Name ) {
@ -1307,8 +1308,8 @@ func setGPO(ctx *cli.Context, cfg *gasprice.Config, light bool) {
// If we are running the light client, apply another group
// If we are running the light client, apply another group
// settings for gas oracle.
// settings for gas oracle.
if light {
if light {
cfg . Blocks = eth . Default LightGPOConfig . Blocks
cfg . Blocks = ethconfig . LightClient GPO . Blocks
cfg . Percentile = eth . Default LightGPOConfig . Percentile
cfg . Percentile = ethconfig . LightClient GPO . Percentile
}
}
if ctx . GlobalIsSet ( LegacyGpoBlocksFlag . Name ) {
if ctx . GlobalIsSet ( LegacyGpoBlocksFlag . Name ) {
cfg . Blocks = ctx . GlobalInt ( LegacyGpoBlocksFlag . Name )
cfg . Blocks = ctx . GlobalInt ( LegacyGpoBlocksFlag . Name )
@ -1372,7 +1373,7 @@ func setTxPool(ctx *cli.Context, cfg *core.TxPoolConfig) {
}
}
}
}
func setEthash ( ctx * cli . Context , cfg * eth . Config ) {
func setEthash ( ctx * cli . Context , cfg * ethconfig . Config ) {
if ctx . GlobalIsSet ( EthashCacheDirFlag . Name ) {
if ctx . GlobalIsSet ( EthashCacheDirFlag . Name ) {
cfg . Ethash . CacheDir = ctx . GlobalString ( EthashCacheDirFlag . Name )
cfg . Ethash . CacheDir = ctx . GlobalString ( EthashCacheDirFlag . Name )
}
}
@ -1435,7 +1436,7 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
}
}
}
}
func setWhitelist ( ctx * cli . Context , cfg * eth . Config ) {
func setWhitelist ( ctx * cli . Context , cfg * ethconfig . Config ) {
whitelist := ctx . GlobalString ( WhitelistFlag . Name )
whitelist := ctx . GlobalString ( WhitelistFlag . Name )
if whitelist == "" {
if whitelist == "" {
return
return
@ -1510,7 +1511,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node) {
}
}
// SetEthConfig applies eth-related command line flags to the config.
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig ( ctx * cli . Context , stack * node . Node , cfg * eth . Config ) {
func SetEthConfig ( ctx * cli . Context , stack * node . Node , cfg * ethconfig . Config ) {
// Avoid conflicting network flags
// Avoid conflicting network flags
CheckExclusive ( ctx , MainnetFlag , DeveloperFlag , LegacyTestnetFlag , RopstenFlag , RinkebyFlag , GoerliFlag , YoloV3Flag )
CheckExclusive ( ctx , MainnetFlag , DeveloperFlag , LegacyTestnetFlag , RopstenFlag , RinkebyFlag , GoerliFlag , YoloV3Flag )
CheckExclusive ( ctx , LegacyLightServFlag , LightServeFlag , SyncModeFlag , "light" )
CheckExclusive ( ctx , LegacyLightServFlag , LightServeFlag , SyncModeFlag , "light" )
@ -1709,7 +1710,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// SetDNSDiscoveryDefaults configures DNS discovery with the given URL if
// SetDNSDiscoveryDefaults configures DNS discovery with the given URL if
// no URLs are set.
// no URLs are set.
func SetDNSDiscoveryDefaults ( cfg * eth . Config , genesis common . Hash ) {
func SetDNSDiscoveryDefaults ( cfg * ethconfig . Config , genesis common . Hash ) {
if cfg . EthDiscoveryURLs != nil {
if cfg . EthDiscoveryURLs != nil {
return // already set through flags/config
return // already set through flags/config
}
}
@ -1728,7 +1729,7 @@ func SetDNSDiscoveryDefaults(cfg *eth.Config, genesis common.Hash) {
}
}
// RegisterEthService adds an Ethereum client to the stack.
// RegisterEthService adds an Ethereum client to the stack.
func RegisterEthService ( stack * node . Node , cfg * eth . Config ) ethapi . Backend {
func RegisterEthService ( stack * node . Node , cfg * ethconfig . Config ) ethapi . Backend {
if cfg . SyncMode == downloader . LightSync {
if cfg . SyncMode == downloader . LightSync {
backend , err := les . New ( stack , cfg )
backend , err := les . New ( stack , cfg )
if err != nil {
if err != nil {
@ -1865,14 +1866,14 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readOnly bool) (chain *core.B
engine = ethash . NewFaker ( )
engine = ethash . NewFaker ( )
if ! ctx . GlobalBool ( FakePoWFlag . Name ) {
if ! ctx . GlobalBool ( FakePoWFlag . Name ) {
engine = ethash . New ( ethash . Config {
engine = ethash . New ( ethash . Config {
CacheDir : stack . ResolvePath ( eth . DefaultConfig . Ethash . CacheDir ) ,
CacheDir : stack . ResolvePath ( ethconfig . Defaults . Ethash . CacheDir ) ,
CachesInMem : eth . DefaultConfig . Ethash . CachesInMem ,
CachesInMem : ethconfig . Defaults . Ethash . CachesInMem ,
CachesOnDisk : eth . DefaultConfig . Ethash . CachesOnDisk ,
CachesOnDisk : ethconfig . Defaults . Ethash . CachesOnDisk ,
CachesLockMmap : eth . DefaultConfig . Ethash . CachesLockMmap ,
CachesLockMmap : ethconfig . Defaults . Ethash . CachesLockMmap ,
DatasetDir : stack . ResolvePath ( eth . DefaultConfig . Ethash . DatasetDir ) ,
DatasetDir : stack . ResolvePath ( ethconfig . Defaults . Ethash . DatasetDir ) ,
DatasetsInMem : eth . DefaultConfig . Ethash . DatasetsInMem ,
DatasetsInMem : ethconfig . Defaults . Ethash . DatasetsInMem ,
DatasetsOnDisk : eth . DefaultConfig . Ethash . DatasetsOnDisk ,
DatasetsOnDisk : ethconfig . Defaults . Ethash . DatasetsOnDisk ,
DatasetsLockMmap : eth . DefaultConfig . Ethash . DatasetsLockMmap ,
DatasetsLockMmap : ethconfig . Defaults . Ethash . DatasetsLockMmap ,
} , nil , false )
} , nil , false )
}
}
}
}
@ -1880,12 +1881,12 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readOnly bool) (chain *core.B
Fatalf ( "--%s must be either 'full' or 'archive'" , GCModeFlag . Name )
Fatalf ( "--%s must be either 'full' or 'archive'" , GCModeFlag . Name )
}
}
cache := & core . CacheConfig {
cache := & core . CacheConfig {
TrieCleanLimit : eth . DefaultConfig . TrieCleanCache ,
TrieCleanLimit : ethconfig . Defaults . TrieCleanCache ,
TrieCleanNoPrefetch : ctx . GlobalBool ( CacheNoPrefetchFlag . Name ) ,
TrieCleanNoPrefetch : ctx . GlobalBool ( CacheNoPrefetchFlag . Name ) ,
TrieDirtyLimit : eth . DefaultConfig . TrieDirtyCache ,
TrieDirtyLimit : ethconfig . Defaults . TrieDirtyCache ,
TrieDirtyDisabled : ctx . GlobalString ( GCModeFlag . Name ) == "archive" ,
TrieDirtyDisabled : ctx . GlobalString ( GCModeFlag . Name ) == "archive" ,
TrieTimeLimit : eth . DefaultConfig . TrieTimeout ,
TrieTimeLimit : ethconfig . Defaults . TrieTimeout ,
SnapshotLimit : eth . DefaultConfig . SnapshotCache ,
SnapshotLimit : ethconfig . Defaults . SnapshotCache ,
Preimages : ctx . GlobalBool ( CachePreimagesFlag . Name ) ,
Preimages : ctx . GlobalBool ( CachePreimagesFlag . Name ) ,
}
}
if cache . TrieDirtyDisabled && ! cache . Preimages {
if cache . TrieDirtyDisabled && ! cache . Preimages {