|
|
|
@ -19,50 +19,49 @@ import ( |
|
|
|
|
// MarshalTOML marshals as TOML.
|
|
|
|
|
func (c Config) MarshalTOML() (interface{}, error) { |
|
|
|
|
type Config struct { |
|
|
|
|
Genesis *core.Genesis `toml:",omitempty"` |
|
|
|
|
NetworkId uint64 |
|
|
|
|
SyncMode downloader.SyncMode |
|
|
|
|
EthDiscoveryURLs []string |
|
|
|
|
SnapDiscoveryURLs []string |
|
|
|
|
NoPruning bool |
|
|
|
|
NoPrefetch bool |
|
|
|
|
TxLookupLimit uint64 `toml:",omitempty"` |
|
|
|
|
RequiredBlocks map[uint64]common.Hash `toml:"-"` |
|
|
|
|
LightServ int `toml:",omitempty"` |
|
|
|
|
LightIngress int `toml:",omitempty"` |
|
|
|
|
LightEgress int `toml:",omitempty"` |
|
|
|
|
LightPeers int `toml:",omitempty"` |
|
|
|
|
LightNoPrune bool `toml:",omitempty"` |
|
|
|
|
LightNoSyncServe bool `toml:",omitempty"` |
|
|
|
|
SyncFromCheckpoint bool `toml:",omitempty"` |
|
|
|
|
UltraLightServers []string `toml:",omitempty"` |
|
|
|
|
UltraLightFraction int `toml:",omitempty"` |
|
|
|
|
UltraLightOnlyAnnounce bool `toml:",omitempty"` |
|
|
|
|
SkipBcVersionCheck bool `toml:"-"` |
|
|
|
|
DatabaseHandles int `toml:"-"` |
|
|
|
|
DatabaseCache int |
|
|
|
|
DatabaseFreezer string |
|
|
|
|
TrieCleanCache int |
|
|
|
|
TrieCleanCacheJournal string `toml:",omitempty"` |
|
|
|
|
TrieCleanCacheRejournal time.Duration `toml:",omitempty"` |
|
|
|
|
TrieDirtyCache int |
|
|
|
|
TrieTimeout time.Duration |
|
|
|
|
SnapshotCache int |
|
|
|
|
Preimages bool |
|
|
|
|
FilterLogCacheSize int |
|
|
|
|
Miner miner.Config |
|
|
|
|
Ethash ethash.Config |
|
|
|
|
TxPool txpool.Config |
|
|
|
|
GPO gasprice.Config |
|
|
|
|
EnablePreimageRecording bool |
|
|
|
|
DocRoot string `toml:"-"` |
|
|
|
|
RPCGasCap uint64 |
|
|
|
|
RPCEVMTimeout time.Duration |
|
|
|
|
RPCTxFeeCap float64 |
|
|
|
|
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` |
|
|
|
|
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` |
|
|
|
|
OverrideTerminalTotalDifficulty *big.Int `toml:",omitempty"` |
|
|
|
|
OverrideTerminalTotalDifficultyPassed *bool `toml:",omitempty"` |
|
|
|
|
Genesis *core.Genesis `toml:",omitempty"` |
|
|
|
|
NetworkId uint64 |
|
|
|
|
SyncMode downloader.SyncMode |
|
|
|
|
EthDiscoveryURLs []string |
|
|
|
|
SnapDiscoveryURLs []string |
|
|
|
|
NoPruning bool |
|
|
|
|
NoPrefetch bool |
|
|
|
|
TxLookupLimit uint64 `toml:",omitempty"` |
|
|
|
|
RequiredBlocks map[uint64]common.Hash `toml:"-"` |
|
|
|
|
LightServ int `toml:",omitempty"` |
|
|
|
|
LightIngress int `toml:",omitempty"` |
|
|
|
|
LightEgress int `toml:",omitempty"` |
|
|
|
|
LightPeers int `toml:",omitempty"` |
|
|
|
|
LightNoPrune bool `toml:",omitempty"` |
|
|
|
|
LightNoSyncServe bool `toml:",omitempty"` |
|
|
|
|
SyncFromCheckpoint bool `toml:",omitempty"` |
|
|
|
|
UltraLightServers []string `toml:",omitempty"` |
|
|
|
|
UltraLightFraction int `toml:",omitempty"` |
|
|
|
|
UltraLightOnlyAnnounce bool `toml:",omitempty"` |
|
|
|
|
SkipBcVersionCheck bool `toml:"-"` |
|
|
|
|
DatabaseHandles int `toml:"-"` |
|
|
|
|
DatabaseCache int |
|
|
|
|
DatabaseFreezer string |
|
|
|
|
TrieCleanCache int |
|
|
|
|
TrieCleanCacheJournal string `toml:",omitempty"` |
|
|
|
|
TrieCleanCacheRejournal time.Duration `toml:",omitempty"` |
|
|
|
|
TrieDirtyCache int |
|
|
|
|
TrieTimeout time.Duration |
|
|
|
|
SnapshotCache int |
|
|
|
|
Preimages bool |
|
|
|
|
FilterLogCacheSize int |
|
|
|
|
Miner miner.Config |
|
|
|
|
Ethash ethash.Config |
|
|
|
|
TxPool txpool.Config |
|
|
|
|
GPO gasprice.Config |
|
|
|
|
EnablePreimageRecording bool |
|
|
|
|
DocRoot string `toml:"-"` |
|
|
|
|
RPCGasCap uint64 |
|
|
|
|
RPCEVMTimeout time.Duration |
|
|
|
|
RPCTxFeeCap float64 |
|
|
|
|
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` |
|
|
|
|
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` |
|
|
|
|
OverrideShanghai *big.Int `toml:",omitempty"` |
|
|
|
|
} |
|
|
|
|
var enc Config |
|
|
|
|
enc.Genesis = c.Genesis |
|
|
|
@ -107,58 +106,56 @@ func (c Config) MarshalTOML() (interface{}, error) { |
|
|
|
|
enc.RPCTxFeeCap = c.RPCTxFeeCap |
|
|
|
|
enc.Checkpoint = c.Checkpoint |
|
|
|
|
enc.CheckpointOracle = c.CheckpointOracle |
|
|
|
|
enc.OverrideTerminalTotalDifficulty = c.OverrideTerminalTotalDifficulty |
|
|
|
|
enc.OverrideTerminalTotalDifficultyPassed = c.OverrideTerminalTotalDifficultyPassed |
|
|
|
|
enc.OverrideShanghai = c.OverrideShanghai |
|
|
|
|
return &enc, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UnmarshalTOML unmarshals from TOML.
|
|
|
|
|
func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { |
|
|
|
|
type Config struct { |
|
|
|
|
Genesis *core.Genesis `toml:",omitempty"` |
|
|
|
|
NetworkId *uint64 |
|
|
|
|
SyncMode *downloader.SyncMode |
|
|
|
|
EthDiscoveryURLs []string |
|
|
|
|
SnapDiscoveryURLs []string |
|
|
|
|
NoPruning *bool |
|
|
|
|
NoPrefetch *bool |
|
|
|
|
TxLookupLimit *uint64 `toml:",omitempty"` |
|
|
|
|
RequiredBlocks map[uint64]common.Hash `toml:"-"` |
|
|
|
|
LightServ *int `toml:",omitempty"` |
|
|
|
|
LightIngress *int `toml:",omitempty"` |
|
|
|
|
LightEgress *int `toml:",omitempty"` |
|
|
|
|
LightPeers *int `toml:",omitempty"` |
|
|
|
|
LightNoPrune *bool `toml:",omitempty"` |
|
|
|
|
LightNoSyncServe *bool `toml:",omitempty"` |
|
|
|
|
SyncFromCheckpoint *bool `toml:",omitempty"` |
|
|
|
|
UltraLightServers []string `toml:",omitempty"` |
|
|
|
|
UltraLightFraction *int `toml:",omitempty"` |
|
|
|
|
UltraLightOnlyAnnounce *bool `toml:",omitempty"` |
|
|
|
|
SkipBcVersionCheck *bool `toml:"-"` |
|
|
|
|
DatabaseHandles *int `toml:"-"` |
|
|
|
|
DatabaseCache *int |
|
|
|
|
DatabaseFreezer *string |
|
|
|
|
TrieCleanCache *int |
|
|
|
|
TrieCleanCacheJournal *string `toml:",omitempty"` |
|
|
|
|
TrieCleanCacheRejournal *time.Duration `toml:",omitempty"` |
|
|
|
|
TrieDirtyCache *int |
|
|
|
|
TrieTimeout *time.Duration |
|
|
|
|
SnapshotCache *int |
|
|
|
|
Preimages *bool |
|
|
|
|
FilterLogCacheSize *int |
|
|
|
|
Miner *miner.Config |
|
|
|
|
Ethash *ethash.Config |
|
|
|
|
TxPool *txpool.Config |
|
|
|
|
GPO *gasprice.Config |
|
|
|
|
EnablePreimageRecording *bool |
|
|
|
|
DocRoot *string `toml:"-"` |
|
|
|
|
RPCGasCap *uint64 |
|
|
|
|
RPCEVMTimeout *time.Duration |
|
|
|
|
RPCTxFeeCap *float64 |
|
|
|
|
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` |
|
|
|
|
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` |
|
|
|
|
OverrideTerminalTotalDifficulty *big.Int `toml:",omitempty"` |
|
|
|
|
OverrideTerminalTotalDifficultyPassed *bool `toml:",omitempty"` |
|
|
|
|
Genesis *core.Genesis `toml:",omitempty"` |
|
|
|
|
NetworkId *uint64 |
|
|
|
|
SyncMode *downloader.SyncMode |
|
|
|
|
EthDiscoveryURLs []string |
|
|
|
|
SnapDiscoveryURLs []string |
|
|
|
|
NoPruning *bool |
|
|
|
|
NoPrefetch *bool |
|
|
|
|
TxLookupLimit *uint64 `toml:",omitempty"` |
|
|
|
|
RequiredBlocks map[uint64]common.Hash `toml:"-"` |
|
|
|
|
LightServ *int `toml:",omitempty"` |
|
|
|
|
LightIngress *int `toml:",omitempty"` |
|
|
|
|
LightEgress *int `toml:",omitempty"` |
|
|
|
|
LightPeers *int `toml:",omitempty"` |
|
|
|
|
LightNoPrune *bool `toml:",omitempty"` |
|
|
|
|
LightNoSyncServe *bool `toml:",omitempty"` |
|
|
|
|
SyncFromCheckpoint *bool `toml:",omitempty"` |
|
|
|
|
UltraLightServers []string `toml:",omitempty"` |
|
|
|
|
UltraLightFraction *int `toml:",omitempty"` |
|
|
|
|
UltraLightOnlyAnnounce *bool `toml:",omitempty"` |
|
|
|
|
SkipBcVersionCheck *bool `toml:"-"` |
|
|
|
|
DatabaseHandles *int `toml:"-"` |
|
|
|
|
DatabaseCache *int |
|
|
|
|
DatabaseFreezer *string |
|
|
|
|
TrieCleanCache *int |
|
|
|
|
TrieCleanCacheJournal *string `toml:",omitempty"` |
|
|
|
|
TrieCleanCacheRejournal *time.Duration `toml:",omitempty"` |
|
|
|
|
TrieDirtyCache *int |
|
|
|
|
TrieTimeout *time.Duration |
|
|
|
|
SnapshotCache *int |
|
|
|
|
Preimages *bool |
|
|
|
|
FilterLogCacheSize *int |
|
|
|
|
Miner *miner.Config |
|
|
|
|
Ethash *ethash.Config |
|
|
|
|
TxPool *txpool.Config |
|
|
|
|
GPO *gasprice.Config |
|
|
|
|
EnablePreimageRecording *bool |
|
|
|
|
DocRoot *string `toml:"-"` |
|
|
|
|
RPCGasCap *uint64 |
|
|
|
|
RPCEVMTimeout *time.Duration |
|
|
|
|
RPCTxFeeCap *float64 |
|
|
|
|
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` |
|
|
|
|
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` |
|
|
|
|
OverrideShanghai *big.Int `toml:",omitempty"` |
|
|
|
|
} |
|
|
|
|
var dec Config |
|
|
|
|
if err := unmarshal(&dec); err != nil { |
|
|
|
@ -290,11 +287,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { |
|
|
|
|
if dec.CheckpointOracle != nil { |
|
|
|
|
c.CheckpointOracle = dec.CheckpointOracle |
|
|
|
|
} |
|
|
|
|
if dec.OverrideTerminalTotalDifficulty != nil { |
|
|
|
|
c.OverrideTerminalTotalDifficulty = dec.OverrideTerminalTotalDifficulty |
|
|
|
|
} |
|
|
|
|
if dec.OverrideTerminalTotalDifficultyPassed != nil { |
|
|
|
|
c.OverrideTerminalTotalDifficultyPassed = dec.OverrideTerminalTotalDifficultyPassed |
|
|
|
|
if dec.OverrideShanghai != nil { |
|
|
|
|
c.OverrideShanghai = dec.OverrideShanghai |
|
|
|
|
} |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|