gen_config.go 10 KB

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