github.com/ethereum/go-ethereum@v1.16.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 "time" 7 8 "github.com/ethereum/go-ethereum/common" 9 "github.com/ethereum/go-ethereum/core" 10 "github.com/ethereum/go-ethereum/core/history" 11 "github.com/ethereum/go-ethereum/core/txpool/blobpool" 12 "github.com/ethereum/go-ethereum/core/txpool/legacypool" 13 "github.com/ethereum/go-ethereum/eth/gasprice" 14 "github.com/ethereum/go-ethereum/miner" 15 ) 16 17 // MarshalTOML marshals as TOML. 18 func (c Config) MarshalTOML() (interface{}, error) { 19 type Config struct { 20 Genesis *core.Genesis `toml:",omitempty"` 21 NetworkId uint64 22 SyncMode SyncMode 23 HistoryMode history.HistoryMode 24 EthDiscoveryURLs []string 25 SnapDiscoveryURLs []string 26 NoPruning bool 27 NoPrefetch bool 28 TxLookupLimit uint64 `toml:",omitempty"` 29 TransactionHistory uint64 `toml:",omitempty"` 30 LogHistory uint64 `toml:",omitempty"` 31 LogNoHistory bool `toml:",omitempty"` 32 LogExportCheckpoints string 33 StateHistory uint64 `toml:",omitempty"` 34 StateScheme string `toml:",omitempty"` 35 RequiredBlocks map[uint64]common.Hash `toml:"-"` 36 SkipBcVersionCheck bool `toml:"-"` 37 DatabaseHandles int `toml:"-"` 38 DatabaseCache int 39 DatabaseFreezer string 40 DatabaseEra string 41 TrieCleanCache int 42 TrieDirtyCache int 43 TrieTimeout time.Duration 44 SnapshotCache int 45 Preimages bool 46 FilterLogCacheSize int 47 Miner miner.Config 48 TxPool legacypool.Config 49 BlobPool blobpool.Config 50 GPO gasprice.Config 51 EnablePreimageRecording bool 52 VMTrace string 53 VMTraceJsonConfig string 54 RPCGasCap uint64 55 RPCEVMTimeout time.Duration 56 RPCTxFeeCap float64 57 OverrideOsaka *uint64 `toml:",omitempty"` 58 OverrideVerkle *uint64 `toml:",omitempty"` 59 } 60 var enc Config 61 enc.Genesis = c.Genesis 62 enc.NetworkId = c.NetworkId 63 enc.SyncMode = c.SyncMode 64 enc.HistoryMode = c.HistoryMode 65 enc.EthDiscoveryURLs = c.EthDiscoveryURLs 66 enc.SnapDiscoveryURLs = c.SnapDiscoveryURLs 67 enc.NoPruning = c.NoPruning 68 enc.NoPrefetch = c.NoPrefetch 69 enc.TxLookupLimit = c.TxLookupLimit 70 enc.TransactionHistory = c.TransactionHistory 71 enc.LogHistory = c.LogHistory 72 enc.LogNoHistory = c.LogNoHistory 73 enc.LogExportCheckpoints = c.LogExportCheckpoints 74 enc.StateHistory = c.StateHistory 75 enc.StateScheme = c.StateScheme 76 enc.RequiredBlocks = c.RequiredBlocks 77 enc.SkipBcVersionCheck = c.SkipBcVersionCheck 78 enc.DatabaseHandles = c.DatabaseHandles 79 enc.DatabaseCache = c.DatabaseCache 80 enc.DatabaseFreezer = c.DatabaseFreezer 81 enc.DatabaseEra = c.DatabaseEra 82 enc.TrieCleanCache = c.TrieCleanCache 83 enc.TrieDirtyCache = c.TrieDirtyCache 84 enc.TrieTimeout = c.TrieTimeout 85 enc.SnapshotCache = c.SnapshotCache 86 enc.Preimages = c.Preimages 87 enc.FilterLogCacheSize = c.FilterLogCacheSize 88 enc.Miner = c.Miner 89 enc.TxPool = c.TxPool 90 enc.BlobPool = c.BlobPool 91 enc.GPO = c.GPO 92 enc.EnablePreimageRecording = c.EnablePreimageRecording 93 enc.VMTrace = c.VMTrace 94 enc.VMTraceJsonConfig = c.VMTraceJsonConfig 95 enc.RPCGasCap = c.RPCGasCap 96 enc.RPCEVMTimeout = c.RPCEVMTimeout 97 enc.RPCTxFeeCap = c.RPCTxFeeCap 98 enc.OverrideOsaka = c.OverrideOsaka 99 enc.OverrideVerkle = c.OverrideVerkle 100 return &enc, nil 101 } 102 103 // UnmarshalTOML unmarshals from TOML. 104 func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { 105 type Config struct { 106 Genesis *core.Genesis `toml:",omitempty"` 107 NetworkId *uint64 108 SyncMode *SyncMode 109 HistoryMode *history.HistoryMode 110 EthDiscoveryURLs []string 111 SnapDiscoveryURLs []string 112 NoPruning *bool 113 NoPrefetch *bool 114 TxLookupLimit *uint64 `toml:",omitempty"` 115 TransactionHistory *uint64 `toml:",omitempty"` 116 LogHistory *uint64 `toml:",omitempty"` 117 LogNoHistory *bool `toml:",omitempty"` 118 LogExportCheckpoints *string 119 StateHistory *uint64 `toml:",omitempty"` 120 StateScheme *string `toml:",omitempty"` 121 RequiredBlocks map[uint64]common.Hash `toml:"-"` 122 SkipBcVersionCheck *bool `toml:"-"` 123 DatabaseHandles *int `toml:"-"` 124 DatabaseCache *int 125 DatabaseFreezer *string 126 DatabaseEra *string 127 TrieCleanCache *int 128 TrieDirtyCache *int 129 TrieTimeout *time.Duration 130 SnapshotCache *int 131 Preimages *bool 132 FilterLogCacheSize *int 133 Miner *miner.Config 134 TxPool *legacypool.Config 135 BlobPool *blobpool.Config 136 GPO *gasprice.Config 137 EnablePreimageRecording *bool 138 VMTrace *string 139 VMTraceJsonConfig *string 140 RPCGasCap *uint64 141 RPCEVMTimeout *time.Duration 142 RPCTxFeeCap *float64 143 OverrideOsaka *uint64 `toml:",omitempty"` 144 OverrideVerkle *uint64 `toml:",omitempty"` 145 } 146 var dec Config 147 if err := unmarshal(&dec); err != nil { 148 return err 149 } 150 if dec.Genesis != nil { 151 c.Genesis = dec.Genesis 152 } 153 if dec.NetworkId != nil { 154 c.NetworkId = *dec.NetworkId 155 } 156 if dec.SyncMode != nil { 157 c.SyncMode = *dec.SyncMode 158 } 159 if dec.HistoryMode != nil { 160 c.HistoryMode = *dec.HistoryMode 161 } 162 if dec.EthDiscoveryURLs != nil { 163 c.EthDiscoveryURLs = dec.EthDiscoveryURLs 164 } 165 if dec.SnapDiscoveryURLs != nil { 166 c.SnapDiscoveryURLs = dec.SnapDiscoveryURLs 167 } 168 if dec.NoPruning != nil { 169 c.NoPruning = *dec.NoPruning 170 } 171 if dec.NoPrefetch != nil { 172 c.NoPrefetch = *dec.NoPrefetch 173 } 174 if dec.TxLookupLimit != nil { 175 c.TxLookupLimit = *dec.TxLookupLimit 176 } 177 if dec.TransactionHistory != nil { 178 c.TransactionHistory = *dec.TransactionHistory 179 } 180 if dec.LogHistory != nil { 181 c.LogHistory = *dec.LogHistory 182 } 183 if dec.LogNoHistory != nil { 184 c.LogNoHistory = *dec.LogNoHistory 185 } 186 if dec.LogExportCheckpoints != nil { 187 c.LogExportCheckpoints = *dec.LogExportCheckpoints 188 } 189 if dec.StateHistory != nil { 190 c.StateHistory = *dec.StateHistory 191 } 192 if dec.StateScheme != nil { 193 c.StateScheme = *dec.StateScheme 194 } 195 if dec.RequiredBlocks != nil { 196 c.RequiredBlocks = dec.RequiredBlocks 197 } 198 if dec.SkipBcVersionCheck != nil { 199 c.SkipBcVersionCheck = *dec.SkipBcVersionCheck 200 } 201 if dec.DatabaseHandles != nil { 202 c.DatabaseHandles = *dec.DatabaseHandles 203 } 204 if dec.DatabaseCache != nil { 205 c.DatabaseCache = *dec.DatabaseCache 206 } 207 if dec.DatabaseFreezer != nil { 208 c.DatabaseFreezer = *dec.DatabaseFreezer 209 } 210 if dec.DatabaseEra != nil { 211 c.DatabaseEra = *dec.DatabaseEra 212 } 213 if dec.TrieCleanCache != nil { 214 c.TrieCleanCache = *dec.TrieCleanCache 215 } 216 if dec.TrieDirtyCache != nil { 217 c.TrieDirtyCache = *dec.TrieDirtyCache 218 } 219 if dec.TrieTimeout != nil { 220 c.TrieTimeout = *dec.TrieTimeout 221 } 222 if dec.SnapshotCache != nil { 223 c.SnapshotCache = *dec.SnapshotCache 224 } 225 if dec.Preimages != nil { 226 c.Preimages = *dec.Preimages 227 } 228 if dec.FilterLogCacheSize != nil { 229 c.FilterLogCacheSize = *dec.FilterLogCacheSize 230 } 231 if dec.Miner != nil { 232 c.Miner = *dec.Miner 233 } 234 if dec.TxPool != nil { 235 c.TxPool = *dec.TxPool 236 } 237 if dec.BlobPool != nil { 238 c.BlobPool = *dec.BlobPool 239 } 240 if dec.GPO != nil { 241 c.GPO = *dec.GPO 242 } 243 if dec.EnablePreimageRecording != nil { 244 c.EnablePreimageRecording = *dec.EnablePreimageRecording 245 } 246 if dec.VMTrace != nil { 247 c.VMTrace = *dec.VMTrace 248 } 249 if dec.VMTraceJsonConfig != nil { 250 c.VMTraceJsonConfig = *dec.VMTraceJsonConfig 251 } 252 if dec.RPCGasCap != nil { 253 c.RPCGasCap = *dec.RPCGasCap 254 } 255 if dec.RPCEVMTimeout != nil { 256 c.RPCEVMTimeout = *dec.RPCEVMTimeout 257 } 258 if dec.RPCTxFeeCap != nil { 259 c.RPCTxFeeCap = *dec.RPCTxFeeCap 260 } 261 if dec.OverrideOsaka != nil { 262 c.OverrideOsaka = dec.OverrideOsaka 263 } 264 if dec.OverrideVerkle != nil { 265 c.OverrideVerkle = dec.OverrideVerkle 266 } 267 return nil 268 }