mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
update : gen_config.go
This commit is contained in:
parent
1fc6354ab1
commit
ee0907a493
1 changed files with 132 additions and 108 deletions
|
|
@ -19,60 +19,64 @@ 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
|
LevelDbCompactionTableSize uint64
|
||||||
TrieCleanCacheJournal string `toml:",omitempty"`
|
LevelDbCompactionTableSizeMultiplier float64
|
||||||
TrieCleanCacheRejournal time.Duration `toml:",omitempty"`
|
LevelDbCompactionTotalSize uint64
|
||||||
TrieDirtyCache int
|
LevelDbCompactionTotalSizeMultiplier float64
|
||||||
TrieTimeout time.Duration
|
TrieCleanCache int
|
||||||
SnapshotCache int
|
TrieCleanCacheJournal string `toml:",omitempty"`
|
||||||
Preimages bool
|
TrieCleanCacheRejournal time.Duration `toml:",omitempty"`
|
||||||
TriesInMemory uint64
|
TrieDirtyCache int
|
||||||
FilterLogCacheSize int
|
TrieTimeout time.Duration
|
||||||
Miner miner.Config
|
SnapshotCache int
|
||||||
Ethash ethash.Config
|
Preimages bool
|
||||||
TxPool txpool.Config
|
TriesInMemory uint64
|
||||||
GPO gasprice.Config
|
FilterLogCacheSize int
|
||||||
EnablePreimageRecording bool
|
Miner miner.Config
|
||||||
DocRoot string `toml:"-"`
|
Ethash ethash.Config
|
||||||
RPCGasCap uint64
|
TxPool txpool.Config
|
||||||
RPCReturnDataLimit uint64
|
GPO gasprice.Config
|
||||||
RPCEVMTimeout time.Duration
|
EnablePreimageRecording bool
|
||||||
RPCTxFeeCap float64
|
DocRoot string `toml:"-"`
|
||||||
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
|
RPCGasCap uint64
|
||||||
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
|
RPCReturnDataLimit uint64
|
||||||
OverrideShanghai *big.Int `toml:",omitempty"`
|
RPCEVMTimeout time.Duration
|
||||||
HeimdallURL string
|
RPCTxFeeCap float64
|
||||||
WithoutHeimdall bool
|
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
|
||||||
HeimdallgRPCAddress string
|
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
|
||||||
RunHeimdall bool
|
OverrideShanghai *big.Int `toml:",omitempty"`
|
||||||
RunHeimdallArgs string
|
HeimdallURL string
|
||||||
UseHeimdallApp bool
|
WithoutHeimdall bool
|
||||||
BorLogs bool
|
HeimdallgRPCAddress string
|
||||||
ParallelEVM core.ParallelEVMConfig `toml:",omitempty"`
|
RunHeimdall bool
|
||||||
DevFakeAuthor bool `hcl:"devfakeauthor,optional" toml:"devfakeauthor,optional"`
|
RunHeimdallArgs string
|
||||||
|
UseHeimdallApp bool
|
||||||
|
BorLogs bool
|
||||||
|
ParallelEVM core.ParallelEVMConfig `toml:",omitempty"`
|
||||||
|
DevFakeAuthor bool `hcl:"devfakeauthor,optional" toml:"devfakeauthor,optional"`
|
||||||
}
|
}
|
||||||
var enc Config
|
var enc Config
|
||||||
enc.Genesis = c.Genesis
|
enc.Genesis = c.Genesis
|
||||||
|
|
@ -98,6 +102,10 @@ func (c Config) MarshalTOML() (interface{}, error) {
|
||||||
enc.DatabaseHandles = c.DatabaseHandles
|
enc.DatabaseHandles = c.DatabaseHandles
|
||||||
enc.DatabaseCache = c.DatabaseCache
|
enc.DatabaseCache = c.DatabaseCache
|
||||||
enc.DatabaseFreezer = c.DatabaseFreezer
|
enc.DatabaseFreezer = c.DatabaseFreezer
|
||||||
|
enc.LevelDbCompactionTableSize = c.LevelDbCompactionTableSize
|
||||||
|
enc.LevelDbCompactionTableSizeMultiplier = c.LevelDbCompactionTableSizeMultiplier
|
||||||
|
enc.LevelDbCompactionTotalSize = c.LevelDbCompactionTotalSize
|
||||||
|
enc.LevelDbCompactionTotalSizeMultiplier = c.LevelDbCompactionTotalSizeMultiplier
|
||||||
enc.TrieCleanCache = c.TrieCleanCache
|
enc.TrieCleanCache = c.TrieCleanCache
|
||||||
enc.TrieCleanCacheJournal = c.TrieCleanCacheJournal
|
enc.TrieCleanCacheJournal = c.TrieCleanCacheJournal
|
||||||
enc.TrieCleanCacheRejournal = c.TrieCleanCacheRejournal
|
enc.TrieCleanCacheRejournal = c.TrieCleanCacheRejournal
|
||||||
|
|
@ -135,60 +143,64 @@ func (c Config) MarshalTOML() (interface{}, error) {
|
||||||
// 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
|
LevelDbCompactionTableSize *uint64
|
||||||
TrieCleanCacheJournal *string `toml:",omitempty"`
|
LevelDbCompactionTableSizeMultiplier *float64
|
||||||
TrieCleanCacheRejournal *time.Duration `toml:",omitempty"`
|
LevelDbCompactionTotalSize *uint64
|
||||||
TrieDirtyCache *int
|
LevelDbCompactionTotalSizeMultiplier *float64
|
||||||
TrieTimeout *time.Duration
|
TrieCleanCache *int
|
||||||
SnapshotCache *int
|
TrieCleanCacheJournal *string `toml:",omitempty"`
|
||||||
Preimages *bool
|
TrieCleanCacheRejournal *time.Duration `toml:",omitempty"`
|
||||||
TriesInMemory *uint64
|
TrieDirtyCache *int
|
||||||
FilterLogCacheSize *int
|
TrieTimeout *time.Duration
|
||||||
Miner *miner.Config
|
SnapshotCache *int
|
||||||
Ethash *ethash.Config
|
Preimages *bool
|
||||||
TxPool *txpool.Config
|
TriesInMemory *uint64
|
||||||
GPO *gasprice.Config
|
FilterLogCacheSize *int
|
||||||
EnablePreimageRecording *bool
|
Miner *miner.Config
|
||||||
DocRoot *string `toml:"-"`
|
Ethash *ethash.Config
|
||||||
RPCGasCap *uint64
|
TxPool *txpool.Config
|
||||||
RPCReturnDataLimit *uint64
|
GPO *gasprice.Config
|
||||||
RPCEVMTimeout *time.Duration
|
EnablePreimageRecording *bool
|
||||||
RPCTxFeeCap *float64
|
DocRoot *string `toml:"-"`
|
||||||
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
|
RPCGasCap *uint64
|
||||||
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
|
RPCReturnDataLimit *uint64
|
||||||
OverrideShanghai *big.Int `toml:",omitempty"`
|
RPCEVMTimeout *time.Duration
|
||||||
HeimdallURL *string
|
RPCTxFeeCap *float64
|
||||||
WithoutHeimdall *bool
|
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
|
||||||
HeimdallgRPCAddress *string
|
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
|
||||||
RunHeimdall *bool
|
OverrideShanghai *big.Int `toml:",omitempty"`
|
||||||
RunHeimdallArgs *string
|
HeimdallURL *string
|
||||||
UseHeimdallApp *bool
|
WithoutHeimdall *bool
|
||||||
BorLogs *bool
|
HeimdallgRPCAddress *string
|
||||||
ParallelEVM *core.ParallelEVMConfig `toml:",omitempty"`
|
RunHeimdall *bool
|
||||||
DevFakeAuthor *bool `hcl:"devfakeauthor,optional" toml:"devfakeauthor,optional"`
|
RunHeimdallArgs *string
|
||||||
|
UseHeimdallApp *bool
|
||||||
|
BorLogs *bool
|
||||||
|
ParallelEVM *core.ParallelEVMConfig `toml:",omitempty"`
|
||||||
|
DevFakeAuthor *bool `hcl:"devfakeauthor,optional" toml:"devfakeauthor,optional"`
|
||||||
}
|
}
|
||||||
var dec Config
|
var dec Config
|
||||||
if err := unmarshal(&dec); err != nil {
|
if err := unmarshal(&dec); err != nil {
|
||||||
|
|
@ -263,6 +275,18 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
|
||||||
if dec.DatabaseFreezer != nil {
|
if dec.DatabaseFreezer != nil {
|
||||||
c.DatabaseFreezer = *dec.DatabaseFreezer
|
c.DatabaseFreezer = *dec.DatabaseFreezer
|
||||||
}
|
}
|
||||||
|
if dec.LevelDbCompactionTableSize != nil {
|
||||||
|
c.LevelDbCompactionTableSize = *dec.LevelDbCompactionTableSize
|
||||||
|
}
|
||||||
|
if dec.LevelDbCompactionTableSizeMultiplier != nil {
|
||||||
|
c.LevelDbCompactionTableSizeMultiplier = *dec.LevelDbCompactionTableSizeMultiplier
|
||||||
|
}
|
||||||
|
if dec.LevelDbCompactionTotalSize != nil {
|
||||||
|
c.LevelDbCompactionTotalSize = *dec.LevelDbCompactionTotalSize
|
||||||
|
}
|
||||||
|
if dec.LevelDbCompactionTotalSizeMultiplier != nil {
|
||||||
|
c.LevelDbCompactionTotalSizeMultiplier = *dec.LevelDbCompactionTotalSizeMultiplier
|
||||||
|
}
|
||||||
if dec.TrieCleanCache != nil {
|
if dec.TrieCleanCache != nil {
|
||||||
c.TrieCleanCache = *dec.TrieCleanCache
|
c.TrieCleanCache = *dec.TrieCleanCache
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue