mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 04:03:49 +00:00
955c669d21
* save * save
167 lines
4.9 KiB
Go
167 lines
4.9 KiB
Go
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
package ethconfig
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/c2h5oh/datasize"
|
|
"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
|
|
P2PEnabled bool
|
|
Prune prune.Mode
|
|
BatchSize datasize.ByteSize
|
|
ImportMode bool
|
|
BadBlockHash common.Hash
|
|
Snapshot Snapshot
|
|
BlockDownloaderWindow int
|
|
ExternalSnapshotDownloaderAddr string
|
|
Whitelist map[uint64]common.Hash `toml:"-"`
|
|
Miner params.MiningConfig
|
|
Ethash ethash.Config
|
|
Clique params.ConsensusSnapshotConfig
|
|
Aura params.AuRaConfig
|
|
Parlia params.ParliaConfig
|
|
TxPool core.TxPoolConfig
|
|
GPO gasprice.Config
|
|
RPCGasCap uint64 `toml:",omitempty"`
|
|
RPCTxFeeCap float64 `toml:",omitempty"`
|
|
StateStream bool
|
|
BodyDownloadTimeoutSeconds int
|
|
SyncLoopThrottle time.Duration
|
|
}
|
|
var enc Config
|
|
enc.Genesis = c.Genesis
|
|
enc.NetworkID = c.NetworkID
|
|
enc.EthDiscoveryURLs = c.EthDiscoveryURLs
|
|
enc.P2PEnabled = c.P2PEnabled
|
|
enc.Prune = c.Prune
|
|
enc.BatchSize = c.BatchSize
|
|
enc.ImportMode = c.ImportMode
|
|
enc.BadBlockHash = c.BadBlockHash
|
|
enc.Snapshot = c.Snapshot
|
|
enc.ExternalSnapshotDownloaderAddr = c.ExternalSnapshotDownloaderAddr
|
|
enc.Whitelist = c.Whitelist
|
|
enc.Miner = c.Miner
|
|
enc.Ethash = c.Ethash
|
|
enc.Clique = c.Clique
|
|
enc.Aura = c.Aura
|
|
enc.Parlia = c.Parlia
|
|
enc.TxPool = c.DeprecatedTxPool
|
|
enc.GPO = c.GPO
|
|
enc.RPCGasCap = c.RPCGasCap
|
|
enc.RPCTxFeeCap = c.RPCTxFeeCap
|
|
enc.StateStream = c.StateStream
|
|
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
|
|
P2PEnabled *bool
|
|
Prune *prune.Mode
|
|
BatchSize *datasize.ByteSize
|
|
ImportMode *bool
|
|
BadBlockHash *common.Hash
|
|
Snapshot *Snapshot
|
|
BlockDownloaderWindow *int
|
|
ExternalSnapshotDownloaderAddr *string
|
|
Whitelist map[uint64]common.Hash `toml:"-"`
|
|
Miner *params.MiningConfig
|
|
Ethash *ethash.Config
|
|
Clique *params.ConsensusSnapshotConfig
|
|
Aura *params.AuRaConfig
|
|
Parlia *params.ParliaConfig
|
|
TxPool *core.TxPoolConfig
|
|
GPO *gasprice.Config
|
|
RPCGasCap *uint64 `toml:",omitempty"`
|
|
RPCTxFeeCap *float64 `toml:",omitempty"`
|
|
StateStream *bool
|
|
BodyDownloadTimeoutSeconds *int
|
|
SyncLoopThrottle *time.Duration
|
|
}
|
|
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.P2PEnabled != nil {
|
|
c.P2PEnabled = *dec.P2PEnabled
|
|
}
|
|
if dec.Prune != nil {
|
|
c.Prune = *dec.Prune
|
|
}
|
|
if dec.BatchSize != nil {
|
|
c.BatchSize = *dec.BatchSize
|
|
}
|
|
if dec.ImportMode != nil {
|
|
c.ImportMode = *dec.ImportMode
|
|
}
|
|
if dec.BadBlockHash != nil {
|
|
c.BadBlockHash = *dec.BadBlockHash
|
|
}
|
|
if dec.Snapshot != nil {
|
|
c.Snapshot = *dec.Snapshot
|
|
}
|
|
if dec.ExternalSnapshotDownloaderAddr != nil {
|
|
c.ExternalSnapshotDownloaderAddr = *dec.ExternalSnapshotDownloaderAddr
|
|
}
|
|
if dec.Whitelist != nil {
|
|
c.Whitelist = dec.Whitelist
|
|
}
|
|
if dec.Miner != nil {
|
|
c.Miner = *dec.Miner
|
|
}
|
|
if dec.Ethash != nil {
|
|
c.Ethash = *dec.Ethash
|
|
}
|
|
if dec.Clique != nil {
|
|
c.Clique = *dec.Clique
|
|
}
|
|
if dec.Aura != nil {
|
|
c.Aura = *dec.Aura
|
|
}
|
|
if dec.Parlia != nil {
|
|
c.Parlia = *dec.Parlia
|
|
}
|
|
if dec.TxPool != nil {
|
|
c.DeprecatedTxPool = *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
|
|
}
|
|
if dec.StateStream != nil {
|
|
c.StateStream = *dec.StateStream
|
|
}
|
|
return nil
|
|
}
|