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