gen_config.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
  2. package ethconfig
  3. import (
  4. "time"
  5. "github.com/ethereum/go-ethereum/common"
  6. "github.com/ethereum/go-ethereum/consensus/ethash"
  7. "github.com/ethereum/go-ethereum/core"
  8. "github.com/ethereum/go-ethereum/eth/downloader"
  9. "github.com/ethereum/go-ethereum/eth/gasprice"
  10. "github.com/ethereum/go-ethereum/miner"
  11. "github.com/ethereum/go-ethereum/params"
  12. )
  13. // MarshalTOML marshals as TOML.
  14. func (c Config) MarshalTOML() (interface{}, error) {
  15. type Config struct {
  16. Genesis *core.Genesis `toml:",omitempty"`
  17. NetworkId uint64
  18. SyncMode downloader.SyncMode
  19. DisablePeerTxBroadcast bool
  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. DatabaseDiff string
  41. TrieCleanCache int
  42. TrieCleanCacheJournal string `toml:",omitempty"`
  43. TrieCleanCacheRejournal time.Duration `toml:",omitempty"`
  44. TrieDirtyCache int
  45. TrieTimeout time.Duration
  46. TriesInMemory uint64 `toml:",omitempty"`
  47. SnapshotCache int
  48. Preimages bool
  49. PersistDiff bool
  50. DiffBlock uint64 `toml:",omitempty"`
  51. Miner miner.Config
  52. Ethash ethash.Config
  53. TxPool core.TxPoolConfig
  54. GPO gasprice.Config
  55. EnablePreimageRecording bool
  56. DocRoot string `toml:"-"`
  57. EWASMInterpreter string
  58. EVMInterpreter string
  59. RPCGasCap uint64 `toml:",omitempty"`
  60. RPCTxFeeCap float64 `toml:",omitempty"`
  61. Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
  62. CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
  63. }
  64. var enc Config
  65. enc.Genesis = c.Genesis
  66. enc.NetworkId = c.NetworkId
  67. enc.SyncMode = c.SyncMode
  68. enc.DisablePeerTxBroadcast = c.DisablePeerTxBroadcast
  69. enc.EthDiscoveryURLs = c.EthDiscoveryURLs
  70. enc.SnapDiscoveryURLs = c.SnapDiscoveryURLs
  71. enc.NoPruning = c.NoPruning
  72. enc.TxLookupLimit = c.TxLookupLimit
  73. enc.Whitelist = c.Whitelist
  74. enc.LightServ = c.LightServ
  75. enc.LightIngress = c.LightIngress
  76. enc.LightEgress = c.LightEgress
  77. enc.LightPeers = c.LightPeers
  78. enc.LightNoPrune = c.LightNoPrune
  79. enc.LightNoSyncServe = c.LightNoSyncServe
  80. enc.SyncFromCheckpoint = c.SyncFromCheckpoint
  81. enc.UltraLightServers = c.UltraLightServers
  82. enc.UltraLightFraction = c.UltraLightFraction
  83. enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce
  84. enc.SkipBcVersionCheck = c.SkipBcVersionCheck
  85. enc.DatabaseHandles = c.DatabaseHandles
  86. enc.DatabaseCache = c.DatabaseCache
  87. enc.DatabaseFreezer = c.DatabaseFreezer
  88. enc.DatabaseDiff = c.DatabaseDiff
  89. enc.TrieCleanCache = c.TrieCleanCache
  90. enc.TrieCleanCacheJournal = c.TrieCleanCacheJournal
  91. enc.TrieCleanCacheRejournal = c.TrieCleanCacheRejournal
  92. enc.TrieDirtyCache = c.TrieDirtyCache
  93. enc.TrieTimeout = c.TrieTimeout
  94. enc.TriesInMemory = c.TriesInMemory
  95. enc.SnapshotCache = c.SnapshotCache
  96. enc.Preimages = c.Preimages
  97. enc.PersistDiff = c.PersistDiff
  98. enc.DiffBlock = c.DiffBlock
  99. enc.Miner = c.Miner
  100. enc.Ethash = c.Ethash
  101. enc.TxPool = c.TxPool
  102. enc.GPO = c.GPO
  103. enc.EnablePreimageRecording = c.EnablePreimageRecording
  104. enc.DocRoot = c.DocRoot
  105. enc.EWASMInterpreter = c.EWASMInterpreter
  106. enc.EVMInterpreter = c.EVMInterpreter
  107. enc.RPCGasCap = c.RPCGasCap
  108. enc.RPCTxFeeCap = c.RPCTxFeeCap
  109. enc.Checkpoint = c.Checkpoint
  110. enc.CheckpointOracle = c.CheckpointOracle
  111. return &enc, nil
  112. }
  113. // UnmarshalTOML unmarshals from TOML.
  114. func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
  115. type Config struct {
  116. Genesis *core.Genesis `toml:",omitempty"`
  117. NetworkId *uint64
  118. SyncMode *downloader.SyncMode
  119. DisablePeerTxBroadcast *bool
  120. EthDiscoveryURLs []string
  121. SnapDiscoveryURLs []string
  122. NoPruning *bool
  123. NoPrefetch *bool
  124. TxLookupLimit *uint64 `toml:",omitempty"`
  125. Whitelist map[uint64]common.Hash `toml:"-"`
  126. LightServ *int `toml:",omitempty"`
  127. LightIngress *int `toml:",omitempty"`
  128. LightEgress *int `toml:",omitempty"`
  129. LightPeers *int `toml:",omitempty"`
  130. LightNoPrune *bool `toml:",omitempty"`
  131. LightNoSyncServe *bool `toml:",omitempty"`
  132. SyncFromCheckpoint *bool `toml:",omitempty"`
  133. UltraLightServers []string `toml:",omitempty"`
  134. UltraLightFraction *int `toml:",omitempty"`
  135. UltraLightOnlyAnnounce *bool `toml:",omitempty"`
  136. SkipBcVersionCheck *bool `toml:"-"`
  137. DatabaseHandles *int `toml:"-"`
  138. DatabaseCache *int
  139. DatabaseFreezer *string
  140. DatabaseDiff *string
  141. PersistDiff *bool
  142. DiffBlock *uint64 `toml:",omitempty"`
  143. TrieCleanCache *int
  144. TrieCleanCacheJournal *string `toml:",omitempty"`
  145. TrieCleanCacheRejournal *time.Duration `toml:",omitempty"`
  146. TrieDirtyCache *int
  147. TrieTimeout *time.Duration
  148. TriesInMemory *uint64 `toml:",omitempty"`
  149. SnapshotCache *int
  150. Preimages *bool
  151. Miner *miner.Config
  152. Ethash *ethash.Config
  153. TxPool *core.TxPoolConfig
  154. GPO *gasprice.Config
  155. EnablePreimageRecording *bool
  156. DocRoot *string `toml:"-"`
  157. EWASMInterpreter *string
  158. EVMInterpreter *string
  159. RPCGasCap *uint64 `toml:",omitempty"`
  160. RPCTxFeeCap *float64 `toml:",omitempty"`
  161. Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
  162. CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
  163. }
  164. var dec Config
  165. if err := unmarshal(&dec); err != nil {
  166. return err
  167. }
  168. if dec.Genesis != nil {
  169. c.Genesis = dec.Genesis
  170. }
  171. if dec.NetworkId != nil {
  172. c.NetworkId = *dec.NetworkId
  173. }
  174. if dec.SyncMode != nil {
  175. c.SyncMode = *dec.SyncMode
  176. }
  177. if dec.DisablePeerTxBroadcast != nil {
  178. c.DisablePeerTxBroadcast = *dec.DisablePeerTxBroadcast
  179. }
  180. if dec.EthDiscoveryURLs != nil {
  181. c.EthDiscoveryURLs = dec.EthDiscoveryURLs
  182. }
  183. if dec.SnapDiscoveryURLs != nil {
  184. c.SnapDiscoveryURLs = dec.SnapDiscoveryURLs
  185. }
  186. if dec.NoPruning != nil {
  187. c.NoPruning = *dec.NoPruning
  188. }
  189. if dec.TxLookupLimit != nil {
  190. c.TxLookupLimit = *dec.TxLookupLimit
  191. }
  192. if dec.Whitelist != nil {
  193. c.Whitelist = dec.Whitelist
  194. }
  195. if dec.LightServ != nil {
  196. c.LightServ = *dec.LightServ
  197. }
  198. if dec.LightIngress != nil {
  199. c.LightIngress = *dec.LightIngress
  200. }
  201. if dec.LightEgress != nil {
  202. c.LightEgress = *dec.LightEgress
  203. }
  204. if dec.LightPeers != nil {
  205. c.LightPeers = *dec.LightPeers
  206. }
  207. if dec.LightNoPrune != nil {
  208. c.LightNoPrune = *dec.LightNoPrune
  209. }
  210. if dec.LightNoSyncServe != nil {
  211. c.LightNoSyncServe = *dec.LightNoSyncServe
  212. }
  213. if dec.SyncFromCheckpoint != nil {
  214. c.SyncFromCheckpoint = *dec.SyncFromCheckpoint
  215. }
  216. if dec.UltraLightServers != nil {
  217. c.UltraLightServers = dec.UltraLightServers
  218. }
  219. if dec.UltraLightFraction != nil {
  220. c.UltraLightFraction = *dec.UltraLightFraction
  221. }
  222. if dec.UltraLightOnlyAnnounce != nil {
  223. c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce
  224. }
  225. if dec.SkipBcVersionCheck != nil {
  226. c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
  227. }
  228. if dec.DatabaseHandles != nil {
  229. c.DatabaseHandles = *dec.DatabaseHandles
  230. }
  231. if dec.DatabaseCache != nil {
  232. c.DatabaseCache = *dec.DatabaseCache
  233. }
  234. if dec.DatabaseFreezer != nil {
  235. c.DatabaseFreezer = *dec.DatabaseFreezer
  236. }
  237. if dec.DatabaseDiff != nil {
  238. c.DatabaseDiff = *dec.DatabaseDiff
  239. }
  240. if dec.PersistDiff != nil {
  241. c.PersistDiff = *dec.PersistDiff
  242. }
  243. if dec.DiffBlock != nil {
  244. c.DiffBlock = *dec.DiffBlock
  245. }
  246. if dec.TrieCleanCache != nil {
  247. c.TrieCleanCache = *dec.TrieCleanCache
  248. }
  249. if dec.TrieCleanCacheJournal != nil {
  250. c.TrieCleanCacheJournal = *dec.TrieCleanCacheJournal
  251. }
  252. if dec.TrieCleanCacheRejournal != nil {
  253. c.TrieCleanCacheRejournal = *dec.TrieCleanCacheRejournal
  254. }
  255. if dec.TrieDirtyCache != nil {
  256. c.TrieDirtyCache = *dec.TrieDirtyCache
  257. }
  258. if dec.TrieTimeout != nil {
  259. c.TrieTimeout = *dec.TrieTimeout
  260. }
  261. if dec.TriesInMemory != nil {
  262. c.TriesInMemory = *dec.TriesInMemory
  263. }
  264. if dec.SnapshotCache != nil {
  265. c.SnapshotCache = *dec.SnapshotCache
  266. }
  267. if dec.Preimages != nil {
  268. c.Preimages = *dec.Preimages
  269. }
  270. if dec.Miner != nil {
  271. c.Miner = *dec.Miner
  272. }
  273. if dec.Ethash != nil {
  274. c.Ethash = *dec.Ethash
  275. }
  276. if dec.TxPool != nil {
  277. c.TxPool = *dec.TxPool
  278. }
  279. if dec.GPO != nil {
  280. c.GPO = *dec.GPO
  281. }
  282. if dec.EnablePreimageRecording != nil {
  283. c.EnablePreimageRecording = *dec.EnablePreimageRecording
  284. }
  285. if dec.DocRoot != nil {
  286. c.DocRoot = *dec.DocRoot
  287. }
  288. if dec.EWASMInterpreter != nil {
  289. c.EWASMInterpreter = *dec.EWASMInterpreter
  290. }
  291. if dec.EVMInterpreter != nil {
  292. c.EVMInterpreter = *dec.EVMInterpreter
  293. }
  294. if dec.RPCGasCap != nil {
  295. c.RPCGasCap = *dec.RPCGasCap
  296. }
  297. if dec.RPCTxFeeCap != nil {
  298. c.RPCTxFeeCap = *dec.RPCTxFeeCap
  299. }
  300. if dec.Checkpoint != nil {
  301. c.Checkpoint = dec.Checkpoint
  302. }
  303. if dec.CheckpointOracle != nil {
  304. c.CheckpointOracle = dec.CheckpointOracle
  305. }
  306. return nil
  307. }