mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 21:47:18 +00:00
117 lines
3.1 KiB
Go
117 lines
3.1 KiB
Go
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
package ethconfig
|
|
|
|
import (
|
|
"github.com/ledgerwatch/erigon/common"
|
|
"github.com/ledgerwatch/erigon/consensus/ethash"
|
|
"github.com/ledgerwatch/erigon/core"
|
|
"github.com/ledgerwatch/erigon/eth/gasprice"
|
|
"github.com/ledgerwatch/erigon/ethdb/prune"
|
|
"github.com/ledgerwatch/erigon/params"
|
|
)
|
|
|
|
// MarshalTOML marshals as TOML.
|
|
func (c Config) MarshalTOML() (interface{}, error) {
|
|
type Config struct {
|
|
Genesis *core.Genesis `toml:",omitempty"`
|
|
NetworkID uint64
|
|
EthDiscoveryURLs []string
|
|
Whitelist map[uint64]common.Hash `toml:"-"`
|
|
StorageMode string
|
|
OnlyAnnounce bool
|
|
Miner params.MiningConfig
|
|
Ethash ethash.Config
|
|
TxPool core.TxPoolConfig
|
|
GPO gasprice.Config
|
|
RPCGasCap uint64 `toml:",omitempty"`
|
|
RPCTxFeeCap float64 `toml:",omitempty"`
|
|
}
|
|
var enc Config
|
|
enc.Genesis = c.Genesis
|
|
enc.NetworkID = c.NetworkID
|
|
enc.EthDiscoveryURLs = c.EthDiscoveryURLs
|
|
enc.Whitelist = c.Whitelist
|
|
enc.StorageMode = c.Prune.String()
|
|
enc.Miner = c.Miner
|
|
enc.Ethash = c.Ethash
|
|
enc.TxPool = c.TxPool
|
|
enc.GPO = c.GPO
|
|
enc.RPCGasCap = c.RPCGasCap
|
|
enc.RPCTxFeeCap = c.RPCTxFeeCap
|
|
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
|
|
EthDiscoveryURLs []string
|
|
Whitelist map[uint64]common.Hash `toml:"-"`
|
|
Mode *string
|
|
PruneH *uint64
|
|
PruneR *uint64
|
|
PruneT *uint64
|
|
PruneC *uint64
|
|
PruneBeforeH *uint64
|
|
PruneBeforeR *uint64
|
|
PruneBeforeT *uint64
|
|
PruneBeforeC *uint64
|
|
Experiments *[]string
|
|
OnlyAnnounce *bool
|
|
SkipBcVersionCheck *bool `toml:"-"`
|
|
DatabaseHandles *int `toml:"-"`
|
|
DatabaseFreezer *string
|
|
Miner *params.MiningConfig
|
|
Ethash *ethash.Config
|
|
TxPool *core.TxPoolConfig
|
|
GPO *gasprice.Config
|
|
RPCGasCap *uint64 `toml:",omitempty"`
|
|
RPCTxFeeCap *float64 `toml:",omitempty"`
|
|
}
|
|
var dec Config
|
|
if err := unmarshal(&dec); err != nil {
|
|
return err
|
|
}
|
|
if dec.Genesis != nil {
|
|
c.Genesis = dec.Genesis
|
|
}
|
|
if dec.NetworkID != nil {
|
|
c.NetworkID = *dec.NetworkID
|
|
}
|
|
if dec.EthDiscoveryURLs != nil {
|
|
c.EthDiscoveryURLs = dec.EthDiscoveryURLs
|
|
}
|
|
if dec.Whitelist != nil {
|
|
c.Whitelist = dec.Whitelist
|
|
}
|
|
if dec.Mode != nil {
|
|
mode, err := prune.FromCli(*dec.Mode, *dec.PruneH, *dec.PruneR, *dec.PruneT, *dec.PruneC,
|
|
*dec.PruneBeforeH, *dec.PruneBeforeR, *dec.PruneBeforeT, *dec.PruneBeforeC, *dec.Experiments)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
c.Prune = mode
|
|
}
|
|
if dec.Miner != nil {
|
|
c.Miner = *dec.Miner
|
|
}
|
|
if dec.Ethash != nil {
|
|
c.Ethash = *dec.Ethash
|
|
}
|
|
if dec.TxPool != nil {
|
|
c.TxPool = *dec.TxPool
|
|
}
|
|
if dec.GPO != nil {
|
|
c.GPO = *dec.GPO
|
|
}
|
|
if dec.RPCGasCap != nil {
|
|
c.RPCGasCap = *dec.RPCGasCap
|
|
}
|
|
if dec.RPCTxFeeCap != nil {
|
|
c.RPCTxFeeCap = *dec.RPCTxFeeCap
|
|
}
|
|
return nil
|
|
}
|