github.com/jonkofee/go-ethereum@v1.11.1/eth/ethconfig/gen_config.go (about)

     1  // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
     2  
     3  package ethconfig
     4  
     5  import (
     6  	"math/big"
     7  	"time"
     8  
     9  	"github.com/jonkofee/go-ethereum/common"
    10  	"github.com/jonkofee/go-ethereum/consensus/ethash"
    11  	"github.com/jonkofee/go-ethereum/core"
    12  	"github.com/jonkofee/go-ethereum/eth/downloader"
    13  	"github.com/jonkofee/go-ethereum/eth/gasprice"
    14  	"github.com/jonkofee/go-ethereum/miner"
    15  	"github.com/jonkofee/go-ethereum/params"
    16  )
    17  
    18  // MarshalTOML marshals as TOML.
    19  func (c Config) MarshalTOML() (interface{}, error) {
    20  	type Config struct {
    21  		Genesis                               *core.Genesis `toml:",omitempty"`
    22  		NetworkId                             uint64
    23  		SyncMode                              downloader.SyncMode
    24  		EthDiscoveryURLs                      []string
    25  		SnapDiscoveryURLs                     []string
    26  		NoPruning                             bool
    27  		NoPrefetch                            bool
    28  		TxLookupLimit                         uint64                 `toml:",omitempty"`
    29  		RequiredBlocks                        map[uint64]common.Hash `toml:"-"`
    30  		LightServ                             int                    `toml:",omitempty"`
    31  		LightIngress                          int                    `toml:",omitempty"`
    32  		LightEgress                           int                    `toml:",omitempty"`
    33  		LightPeers                            int                    `toml:",omitempty"`
    34  		LightNoPrune                          bool                   `toml:",omitempty"`
    35  		LightNoSyncServe                      bool                   `toml:",omitempty"`
    36  		SyncFromCheckpoint                    bool                   `toml:",omitempty"`
    37  		UltraLightServers                     []string               `toml:",omitempty"`
    38  		UltraLightFraction                    int                    `toml:",omitempty"`
    39  		UltraLightOnlyAnnounce                bool                   `toml:",omitempty"`
    40  		SkipBcVersionCheck                    bool                   `toml:"-"`
    41  		DatabaseHandles                       int                    `toml:"-"`
    42  		DatabaseCache                         int
    43  		DatabaseFreezer                       string
    44  		TrieCleanCache                        int
    45  		TrieCleanCacheJournal                 string        `toml:",omitempty"`
    46  		TrieCleanCacheRejournal               time.Duration `toml:",omitempty"`
    47  		TrieDirtyCache                        int
    48  		TrieTimeout                           time.Duration
    49  		SnapshotCache                         int
    50  		Preimages                             bool
    51  		FilterLogCacheSize                    int
    52  		Miner                                 miner.Config
    53  		Ethash                                ethash.Config
    54  		TxPool                                core.TxPoolConfig
    55  		GPO                                   gasprice.Config
    56  		EnablePreimageRecording               bool
    57  		DocRoot                               string `toml:"-"`
    58  		RPCGasCap                             uint64
    59  		RPCEVMTimeout                         time.Duration
    60  		RPCTxFeeCap                           float64
    61  		Checkpoint                            *params.TrustedCheckpoint      `toml:",omitempty"`
    62  		CheckpointOracle                      *params.CheckpointOracleConfig `toml:",omitempty"`
    63  		OverrideTerminalTotalDifficulty       *big.Int                       `toml:",omitempty"`
    64  		OverrideTerminalTotalDifficultyPassed *bool                          `toml:",omitempty"`
    65  	}
    66  	var enc Config
    67  	enc.Genesis = c.Genesis
    68  	enc.NetworkId = c.NetworkId
    69  	enc.SyncMode = c.SyncMode
    70  	enc.EthDiscoveryURLs = c.EthDiscoveryURLs
    71  	enc.SnapDiscoveryURLs = c.SnapDiscoveryURLs
    72  	enc.NoPruning = c.NoPruning
    73  	enc.NoPrefetch = c.NoPrefetch
    74  	enc.TxLookupLimit = c.TxLookupLimit
    75  	enc.RequiredBlocks = c.RequiredBlocks
    76  	enc.LightServ = c.LightServ
    77  	enc.LightIngress = c.LightIngress
    78  	enc.LightEgress = c.LightEgress
    79  	enc.LightPeers = c.LightPeers
    80  	enc.LightNoPrune = c.LightNoPrune
    81  	enc.LightNoSyncServe = c.LightNoSyncServe
    82  	enc.SyncFromCheckpoint = c.SyncFromCheckpoint
    83  	enc.UltraLightServers = c.UltraLightServers
    84  	enc.UltraLightFraction = c.UltraLightFraction
    85  	enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce
    86  	enc.SkipBcVersionCheck = c.SkipBcVersionCheck
    87  	enc.DatabaseHandles = c.DatabaseHandles
    88  	enc.DatabaseCache = c.DatabaseCache
    89  	enc.DatabaseFreezer = c.DatabaseFreezer
    90  	enc.TrieCleanCache = c.TrieCleanCache
    91  	enc.TrieCleanCacheJournal = c.TrieCleanCacheJournal
    92  	enc.TrieCleanCacheRejournal = c.TrieCleanCacheRejournal
    93  	enc.TrieDirtyCache = c.TrieDirtyCache
    94  	enc.TrieTimeout = c.TrieTimeout
    95  	enc.SnapshotCache = c.SnapshotCache
    96  	enc.Preimages = c.Preimages
    97  	enc.FilterLogCacheSize = c.FilterLogCacheSize
    98  	enc.Miner = c.Miner
    99  	enc.Ethash = c.Ethash
   100  	enc.TxPool = c.TxPool
   101  	enc.GPO = c.GPO
   102  	enc.EnablePreimageRecording = c.EnablePreimageRecording
   103  	enc.DocRoot = c.DocRoot
   104  	enc.RPCGasCap = c.RPCGasCap
   105  	enc.RPCEVMTimeout = c.RPCEVMTimeout
   106  	enc.RPCTxFeeCap = c.RPCTxFeeCap
   107  	enc.Checkpoint = c.Checkpoint
   108  	enc.CheckpointOracle = c.CheckpointOracle
   109  	enc.OverrideTerminalTotalDifficulty = c.OverrideTerminalTotalDifficulty
   110  	enc.OverrideTerminalTotalDifficultyPassed = c.OverrideTerminalTotalDifficultyPassed
   111  	return &enc, nil
   112  }
   113  
   114  // UnmarshalTOML unmarshals from TOML.
   115  func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
   116  	type Config struct {
   117  		Genesis                               *core.Genesis `toml:",omitempty"`
   118  		NetworkId                             *uint64
   119  		SyncMode                              *downloader.SyncMode
   120  		EthDiscoveryURLs                      []string
   121  		SnapDiscoveryURLs                     []string
   122  		NoPruning                             *bool
   123  		NoPrefetch                            *bool
   124  		TxLookupLimit                         *uint64                `toml:",omitempty"`
   125  		RequiredBlocks                        map[uint64]common.Hash `toml:"-"`
   126  		LightServ                             *int                   `toml:",omitempty"`
   127  		LightIngress                          *int                   `toml:",omitempty"`
   128  		LightEgress                           *int                   `toml:",omitempty"`
   129  		LightPeers                            *int                   `toml:",omitempty"`
   130  		LightNoPrune                          *bool                  `toml:",omitempty"`
   131  		LightNoSyncServe                      *bool                  `toml:",omitempty"`
   132  		SyncFromCheckpoint                    *bool                  `toml:",omitempty"`
   133  		UltraLightServers                     []string               `toml:",omitempty"`
   134  		UltraLightFraction                    *int                   `toml:",omitempty"`
   135  		UltraLightOnlyAnnounce                *bool                  `toml:",omitempty"`
   136  		SkipBcVersionCheck                    *bool                  `toml:"-"`
   137  		DatabaseHandles                       *int                   `toml:"-"`
   138  		DatabaseCache                         *int
   139  		DatabaseFreezer                       *string
   140  		TrieCleanCache                        *int
   141  		TrieCleanCacheJournal                 *string        `toml:",omitempty"`
   142  		TrieCleanCacheRejournal               *time.Duration `toml:",omitempty"`
   143  		TrieDirtyCache                        *int
   144  		TrieTimeout                           *time.Duration
   145  		SnapshotCache                         *int
   146  		Preimages                             *bool
   147  		FilterLogCacheSize                    *int
   148  		Miner                                 *miner.Config
   149  		Ethash                                *ethash.Config
   150  		TxPool                                *core.TxPoolConfig
   151  		GPO                                   *gasprice.Config
   152  		EnablePreimageRecording               *bool
   153  		DocRoot                               *string `toml:"-"`
   154  		RPCGasCap                             *uint64
   155  		RPCEVMTimeout                         *time.Duration
   156  		RPCTxFeeCap                           *float64
   157  		Checkpoint                            *params.TrustedCheckpoint      `toml:",omitempty"`
   158  		CheckpointOracle                      *params.CheckpointOracleConfig `toml:",omitempty"`
   159  		OverrideTerminalTotalDifficulty       *big.Int                       `toml:",omitempty"`
   160  		OverrideTerminalTotalDifficultyPassed *bool                          `toml:",omitempty"`
   161  	}
   162  	var dec Config
   163  	if err := unmarshal(&dec); err != nil {
   164  		return err
   165  	}
   166  	if dec.Genesis != nil {
   167  		c.Genesis = dec.Genesis
   168  	}
   169  	if dec.NetworkId != nil {
   170  		c.NetworkId = *dec.NetworkId
   171  	}
   172  	if dec.SyncMode != nil {
   173  		c.SyncMode = *dec.SyncMode
   174  	}
   175  	if dec.EthDiscoveryURLs != nil {
   176  		c.EthDiscoveryURLs = dec.EthDiscoveryURLs
   177  	}
   178  	if dec.SnapDiscoveryURLs != nil {
   179  		c.SnapDiscoveryURLs = dec.SnapDiscoveryURLs
   180  	}
   181  	if dec.NoPruning != nil {
   182  		c.NoPruning = *dec.NoPruning
   183  	}
   184  	if dec.NoPrefetch != nil {
   185  		c.NoPrefetch = *dec.NoPrefetch
   186  	}
   187  	if dec.TxLookupLimit != nil {
   188  		c.TxLookupLimit = *dec.TxLookupLimit
   189  	}
   190  	if dec.RequiredBlocks != nil {
   191  		c.RequiredBlocks = dec.RequiredBlocks
   192  	}
   193  	if dec.LightServ != nil {
   194  		c.LightServ = *dec.LightServ
   195  	}
   196  	if dec.LightIngress != nil {
   197  		c.LightIngress = *dec.LightIngress
   198  	}
   199  	if dec.LightEgress != nil {
   200  		c.LightEgress = *dec.LightEgress
   201  	}
   202  	if dec.LightPeers != nil {
   203  		c.LightPeers = *dec.LightPeers
   204  	}
   205  	if dec.LightNoPrune != nil {
   206  		c.LightNoPrune = *dec.LightNoPrune
   207  	}
   208  	if dec.LightNoSyncServe != nil {
   209  		c.LightNoSyncServe = *dec.LightNoSyncServe
   210  	}
   211  	if dec.SyncFromCheckpoint != nil {
   212  		c.SyncFromCheckpoint = *dec.SyncFromCheckpoint
   213  	}
   214  	if dec.UltraLightServers != nil {
   215  		c.UltraLightServers = dec.UltraLightServers
   216  	}
   217  	if dec.UltraLightFraction != nil {
   218  		c.UltraLightFraction = *dec.UltraLightFraction
   219  	}
   220  	if dec.UltraLightOnlyAnnounce != nil {
   221  		c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce
   222  	}
   223  	if dec.SkipBcVersionCheck != nil {
   224  		c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
   225  	}
   226  	if dec.DatabaseHandles != nil {
   227  		c.DatabaseHandles = *dec.DatabaseHandles
   228  	}
   229  	if dec.DatabaseCache != nil {
   230  		c.DatabaseCache = *dec.DatabaseCache
   231  	}
   232  	if dec.DatabaseFreezer != nil {
   233  		c.DatabaseFreezer = *dec.DatabaseFreezer
   234  	}
   235  	if dec.TrieCleanCache != nil {
   236  		c.TrieCleanCache = *dec.TrieCleanCache
   237  	}
   238  	if dec.TrieCleanCacheJournal != nil {
   239  		c.TrieCleanCacheJournal = *dec.TrieCleanCacheJournal
   240  	}
   241  	if dec.TrieCleanCacheRejournal != nil {
   242  		c.TrieCleanCacheRejournal = *dec.TrieCleanCacheRejournal
   243  	}
   244  	if dec.TrieDirtyCache != nil {
   245  		c.TrieDirtyCache = *dec.TrieDirtyCache
   246  	}
   247  	if dec.TrieTimeout != nil {
   248  		c.TrieTimeout = *dec.TrieTimeout
   249  	}
   250  	if dec.SnapshotCache != nil {
   251  		c.SnapshotCache = *dec.SnapshotCache
   252  	}
   253  	if dec.Preimages != nil {
   254  		c.Preimages = *dec.Preimages
   255  	}
   256  	if dec.FilterLogCacheSize != nil {
   257  		c.FilterLogCacheSize = *dec.FilterLogCacheSize
   258  	}
   259  	if dec.Miner != nil {
   260  		c.Miner = *dec.Miner
   261  	}
   262  	if dec.Ethash != nil {
   263  		c.Ethash = *dec.Ethash
   264  	}
   265  	if dec.TxPool != nil {
   266  		c.TxPool = *dec.TxPool
   267  	}
   268  	if dec.GPO != nil {
   269  		c.GPO = *dec.GPO
   270  	}
   271  	if dec.EnablePreimageRecording != nil {
   272  		c.EnablePreimageRecording = *dec.EnablePreimageRecording
   273  	}
   274  	if dec.DocRoot != nil {
   275  		c.DocRoot = *dec.DocRoot
   276  	}
   277  	if dec.RPCGasCap != nil {
   278  		c.RPCGasCap = *dec.RPCGasCap
   279  	}
   280  	if dec.RPCEVMTimeout != nil {
   281  		c.RPCEVMTimeout = *dec.RPCEVMTimeout
   282  	}
   283  	if dec.RPCTxFeeCap != nil {
   284  		c.RPCTxFeeCap = *dec.RPCTxFeeCap
   285  	}
   286  	if dec.Checkpoint != nil {
   287  		c.Checkpoint = dec.Checkpoint
   288  	}
   289  	if dec.CheckpointOracle != nil {
   290  		c.CheckpointOracle = dec.CheckpointOracle
   291  	}
   292  	if dec.OverrideTerminalTotalDifficulty != nil {
   293  		c.OverrideTerminalTotalDifficulty = dec.OverrideTerminalTotalDifficulty
   294  	}
   295  	if dec.OverrideTerminalTotalDifficultyPassed != nil {
   296  		c.OverrideTerminalTotalDifficultyPassed = dec.OverrideTerminalTotalDifficultyPassed
   297  	}
   298  	return nil
   299  }