github.com/zhiqiangxu/go-ethereum@v1.9.16-0.20210824055606-be91cfdebc48/eth/gen_config.go (about) 1 // Code generated by github.com/fjl/gencodec. DO NOT EDIT. 2 3 package eth 4 5 import ( 6 "math/big" 7 "time" 8 9 "github.com/zhiqiangxu/go-ethereum/common" 10 "github.com/zhiqiangxu/go-ethereum/consensus/ethash" 11 "github.com/zhiqiangxu/go-ethereum/core" 12 "github.com/zhiqiangxu/go-ethereum/eth/downloader" 13 "github.com/zhiqiangxu/go-ethereum/eth/gasprice" 14 "github.com/zhiqiangxu/go-ethereum/miner" 15 "github.com/zhiqiangxu/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 DiscoveryURLs []string 25 NoPruning bool 26 NoPrefetch bool 27 TxLookupLimit uint64 `toml:",omitempty"` 28 Whitelist map[uint64]common.Hash `toml:"-"` 29 LightServ int `toml:",omitempty"` 30 LightIngress int `toml:",omitempty"` 31 LightEgress int `toml:",omitempty"` 32 LightPeers int `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 TrieDirtyCache int 42 TrieTimeout time.Duration 43 Miner miner.Config 44 Ethash ethash.Config 45 TxPool core.TxPoolConfig 46 GPO gasprice.Config 47 EnablePreimageRecording bool 48 DocRoot string `toml:"-"` 49 EWASMInterpreter string 50 EVMInterpreter string 51 RPCGasCap *big.Int `toml:",omitempty"` 52 Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` 53 CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` 54 OverrideIstanbul *big.Int `toml:",omitempty"` 55 OverrideMuirGlacier *big.Int `toml:",omitempty"` 56 } 57 var enc Config 58 enc.Genesis = c.Genesis 59 enc.NetworkId = c.NetworkId 60 enc.SyncMode = c.SyncMode 61 enc.DiscoveryURLs = c.DiscoveryURLs 62 enc.NoPruning = c.NoPruning 63 enc.NoPrefetch = c.NoPrefetch 64 enc.TxLookupLimit = c.TxLookupLimit 65 enc.Whitelist = c.Whitelist 66 enc.LightServ = c.LightServ 67 enc.LightIngress = c.LightIngress 68 enc.LightEgress = c.LightEgress 69 enc.LightPeers = c.LightPeers 70 enc.UltraLightServers = c.UltraLightServers 71 enc.UltraLightFraction = c.UltraLightFraction 72 enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce 73 enc.SkipBcVersionCheck = c.SkipBcVersionCheck 74 enc.DatabaseHandles = c.DatabaseHandles 75 enc.DatabaseCache = c.DatabaseCache 76 enc.DatabaseFreezer = c.DatabaseFreezer 77 enc.TrieCleanCache = c.TrieCleanCache 78 enc.TrieDirtyCache = c.TrieDirtyCache 79 enc.TrieTimeout = c.TrieTimeout 80 enc.Miner = c.Miner 81 enc.Ethash = c.Ethash 82 enc.TxPool = c.TxPool 83 enc.GPO = c.GPO 84 enc.EnablePreimageRecording = c.EnablePreimageRecording 85 enc.DocRoot = c.DocRoot 86 enc.EWASMInterpreter = c.EWASMInterpreter 87 enc.EVMInterpreter = c.EVMInterpreter 88 enc.RPCGasCap = c.RPCGasCap 89 enc.Checkpoint = c.Checkpoint 90 enc.CheckpointOracle = c.CheckpointOracle 91 return &enc, nil 92 } 93 94 // UnmarshalTOML unmarshals from TOML. 95 func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { 96 type Config struct { 97 Genesis *core.Genesis `toml:",omitempty"` 98 NetworkId *uint64 99 SyncMode *downloader.SyncMode 100 DiscoveryURLs []string 101 NoPruning *bool 102 NoPrefetch *bool 103 TxLookupLimit *uint64 `toml:",omitempty"` 104 Whitelist map[uint64]common.Hash `toml:"-"` 105 LightServ *int `toml:",omitempty"` 106 LightIngress *int `toml:",omitempty"` 107 LightEgress *int `toml:",omitempty"` 108 LightPeers *int `toml:",omitempty"` 109 UltraLightServers []string `toml:",omitempty"` 110 UltraLightFraction *int `toml:",omitempty"` 111 UltraLightOnlyAnnounce *bool `toml:",omitempty"` 112 SkipBcVersionCheck *bool `toml:"-"` 113 DatabaseHandles *int `toml:"-"` 114 DatabaseCache *int 115 DatabaseFreezer *string 116 TrieCleanCache *int 117 TrieDirtyCache *int 118 TrieTimeout *time.Duration 119 Miner *miner.Config 120 Ethash *ethash.Config 121 TxPool *core.TxPoolConfig 122 GPO *gasprice.Config 123 EnablePreimageRecording *bool 124 DocRoot *string `toml:"-"` 125 EWASMInterpreter *string 126 EVMInterpreter *string 127 RPCGasCap *big.Int `toml:",omitempty"` 128 Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` 129 CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` 130 OverrideIstanbul *big.Int `toml:",omitempty"` 131 OverrideMuirGlacier *big.Int `toml:",omitempty"` 132 } 133 var dec Config 134 if err := unmarshal(&dec); err != nil { 135 return err 136 } 137 if dec.Genesis != nil { 138 c.Genesis = dec.Genesis 139 } 140 if dec.NetworkId != nil { 141 c.NetworkId = *dec.NetworkId 142 } 143 if dec.SyncMode != nil { 144 c.SyncMode = *dec.SyncMode 145 } 146 if dec.DiscoveryURLs != nil { 147 c.DiscoveryURLs = dec.DiscoveryURLs 148 } 149 if dec.NoPruning != nil { 150 c.NoPruning = *dec.NoPruning 151 } 152 if dec.NoPrefetch != nil { 153 c.NoPrefetch = *dec.NoPrefetch 154 } 155 if dec.TxLookupLimit != nil { 156 c.TxLookupLimit = *dec.TxLookupLimit 157 } 158 if dec.Whitelist != nil { 159 c.Whitelist = dec.Whitelist 160 } 161 if dec.LightServ != nil { 162 c.LightServ = *dec.LightServ 163 } 164 if dec.LightIngress != nil { 165 c.LightIngress = *dec.LightIngress 166 } 167 if dec.LightEgress != nil { 168 c.LightEgress = *dec.LightEgress 169 } 170 if dec.LightPeers != nil { 171 c.LightPeers = *dec.LightPeers 172 } 173 if dec.UltraLightServers != nil { 174 c.UltraLightServers = dec.UltraLightServers 175 } 176 if dec.UltraLightFraction != nil { 177 c.UltraLightFraction = *dec.UltraLightFraction 178 } 179 if dec.UltraLightOnlyAnnounce != nil { 180 c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce 181 } 182 if dec.SkipBcVersionCheck != nil { 183 c.SkipBcVersionCheck = *dec.SkipBcVersionCheck 184 } 185 if dec.DatabaseHandles != nil { 186 c.DatabaseHandles = *dec.DatabaseHandles 187 } 188 if dec.DatabaseCache != nil { 189 c.DatabaseCache = *dec.DatabaseCache 190 } 191 if dec.DatabaseFreezer != nil { 192 c.DatabaseFreezer = *dec.DatabaseFreezer 193 } 194 if dec.TrieCleanCache != nil { 195 c.TrieCleanCache = *dec.TrieCleanCache 196 } 197 if dec.TrieDirtyCache != nil { 198 c.TrieDirtyCache = *dec.TrieDirtyCache 199 } 200 if dec.TrieTimeout != nil { 201 c.TrieTimeout = *dec.TrieTimeout 202 } 203 if dec.Miner != nil { 204 c.Miner = *dec.Miner 205 } 206 if dec.Ethash != nil { 207 c.Ethash = *dec.Ethash 208 } 209 if dec.TxPool != nil { 210 c.TxPool = *dec.TxPool 211 } 212 if dec.GPO != nil { 213 c.GPO = *dec.GPO 214 } 215 if dec.EnablePreimageRecording != nil { 216 c.EnablePreimageRecording = *dec.EnablePreimageRecording 217 } 218 if dec.DocRoot != nil { 219 c.DocRoot = *dec.DocRoot 220 } 221 if dec.EWASMInterpreter != nil { 222 c.EWASMInterpreter = *dec.EWASMInterpreter 223 } 224 if dec.EVMInterpreter != nil { 225 c.EVMInterpreter = *dec.EVMInterpreter 226 } 227 if dec.RPCGasCap != nil { 228 c.RPCGasCap = dec.RPCGasCap 229 } 230 if dec.Checkpoint != nil { 231 c.Checkpoint = dec.Checkpoint 232 } 233 if dec.CheckpointOracle != nil { 234 c.CheckpointOracle = dec.CheckpointOracle 235 } 236 return nil 237 }