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