gen_config.go 7.8 KB

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