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