gen_config.go 9.2 KB

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