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