gen_config.go 8.6 KB

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