gen_config.go 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
  2. package eth
  3. import (
  4. "math/big"
  5. "time"
  6. "github.com/ethereum/go-ethereum/common"
  7. "github.com/ethereum/go-ethereum/consensus/ethash"
  8. "github.com/ethereum/go-ethereum/core"
  9. "github.com/ethereum/go-ethereum/eth/downloader"
  10. "github.com/ethereum/go-ethereum/eth/gasprice"
  11. "github.com/ethereum/go-ethereum/miner"
  12. "github.com/ethereum/go-ethereum/params"
  13. )
  14. // MarshalTOML marshals as TOML.
  15. func (c Config) MarshalTOML() (interface{}, error) {
  16. type Config struct {
  17. Genesis *core.Genesis `toml:",omitempty"`
  18. NetworkId uint64
  19. SyncMode downloader.SyncMode
  20. DiscoveryURLs []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. 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. TrieDirtyCache int
  38. TrieTimeout time.Duration
  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 *big.Int `toml:",omitempty"`
  48. Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
  49. CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
  50. OverrideIstanbul *big.Int `toml:",omitempty"`
  51. OverrideMuirGlacier *big.Int `toml:",omitempty"`
  52. }
  53. var enc Config
  54. enc.Genesis = c.Genesis
  55. enc.NetworkId = c.NetworkId
  56. enc.SyncMode = c.SyncMode
  57. enc.DiscoveryURLs = c.DiscoveryURLs
  58. enc.NoPruning = c.NoPruning
  59. enc.NoPrefetch = c.NoPrefetch
  60. enc.TxLookupLimit = c.TxLookupLimit
  61. enc.Whitelist = c.Whitelist
  62. enc.LightServ = c.LightServ
  63. enc.LightIngress = c.LightIngress
  64. enc.LightEgress = c.LightEgress
  65. enc.LightPeers = c.LightPeers
  66. enc.UltraLightServers = c.UltraLightServers
  67. enc.UltraLightFraction = c.UltraLightFraction
  68. enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce
  69. enc.SkipBcVersionCheck = c.SkipBcVersionCheck
  70. enc.DatabaseHandles = c.DatabaseHandles
  71. enc.DatabaseCache = c.DatabaseCache
  72. enc.DatabaseFreezer = c.DatabaseFreezer
  73. enc.TrieCleanCache = c.TrieCleanCache
  74. enc.TrieDirtyCache = c.TrieDirtyCache
  75. enc.TrieTimeout = c.TrieTimeout
  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.Checkpoint = c.Checkpoint
  86. enc.CheckpointOracle = c.CheckpointOracle
  87. return &enc, nil
  88. }
  89. // UnmarshalTOML unmarshals from TOML.
  90. func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
  91. type Config struct {
  92. Genesis *core.Genesis `toml:",omitempty"`
  93. NetworkId *uint64
  94. SyncMode *downloader.SyncMode
  95. DiscoveryURLs []string
  96. NoPruning *bool
  97. NoPrefetch *bool
  98. TxLookupLimit *uint64 `toml:",omitempty"`
  99. Whitelist map[uint64]common.Hash `toml:"-"`
  100. LightServ *int `toml:",omitempty"`
  101. LightIngress *int `toml:",omitempty"`
  102. LightEgress *int `toml:",omitempty"`
  103. LightPeers *int `toml:",omitempty"`
  104. UltraLightServers []string `toml:",omitempty"`
  105. UltraLightFraction *int `toml:",omitempty"`
  106. UltraLightOnlyAnnounce *bool `toml:",omitempty"`
  107. SkipBcVersionCheck *bool `toml:"-"`
  108. DatabaseHandles *int `toml:"-"`
  109. DatabaseCache *int
  110. DatabaseFreezer *string
  111. TrieCleanCache *int
  112. TrieDirtyCache *int
  113. TrieTimeout *time.Duration
  114. Miner *miner.Config
  115. Ethash *ethash.Config
  116. TxPool *core.TxPoolConfig
  117. GPO *gasprice.Config
  118. EnablePreimageRecording *bool
  119. DocRoot *string `toml:"-"`
  120. EWASMInterpreter *string
  121. EVMInterpreter *string
  122. RPCGasCap *big.Int `toml:",omitempty"`
  123. Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
  124. CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
  125. OverrideIstanbul *big.Int `toml:",omitempty"`
  126. OverrideMuirGlacier *big.Int `toml:",omitempty"`
  127. }
  128. var dec Config
  129. if err := unmarshal(&dec); err != nil {
  130. return err
  131. }
  132. if dec.Genesis != nil {
  133. c.Genesis = dec.Genesis
  134. }
  135. if dec.NetworkId != nil {
  136. c.NetworkId = *dec.NetworkId
  137. }
  138. if dec.SyncMode != nil {
  139. c.SyncMode = *dec.SyncMode
  140. }
  141. if dec.DiscoveryURLs != nil {
  142. c.DiscoveryURLs = dec.DiscoveryURLs
  143. }
  144. if dec.NoPruning != nil {
  145. c.NoPruning = *dec.NoPruning
  146. }
  147. if dec.NoPrefetch != nil {
  148. c.NoPrefetch = *dec.NoPrefetch
  149. }
  150. if dec.TxLookupLimit != nil {
  151. c.TxLookupLimit = *dec.TxLookupLimit
  152. }
  153. if dec.Whitelist != nil {
  154. c.Whitelist = dec.Whitelist
  155. }
  156. if dec.LightServ != nil {
  157. c.LightServ = *dec.LightServ
  158. }
  159. if dec.LightIngress != nil {
  160. c.LightIngress = *dec.LightIngress
  161. }
  162. if dec.LightEgress != nil {
  163. c.LightEgress = *dec.LightEgress
  164. }
  165. if dec.LightPeers != nil {
  166. c.LightPeers = *dec.LightPeers
  167. }
  168. if dec.UltraLightServers != nil {
  169. c.UltraLightServers = dec.UltraLightServers
  170. }
  171. if dec.UltraLightFraction != nil {
  172. c.UltraLightFraction = *dec.UltraLightFraction
  173. }
  174. if dec.UltraLightOnlyAnnounce != nil {
  175. c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce
  176. }
  177. if dec.SkipBcVersionCheck != nil {
  178. c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
  179. }
  180. if dec.DatabaseHandles != nil {
  181. c.DatabaseHandles = *dec.DatabaseHandles
  182. }
  183. if dec.DatabaseCache != nil {
  184. c.DatabaseCache = *dec.DatabaseCache
  185. }
  186. if dec.DatabaseFreezer != nil {
  187. c.DatabaseFreezer = *dec.DatabaseFreezer
  188. }
  189. if dec.TrieCleanCache != nil {
  190. c.TrieCleanCache = *dec.TrieCleanCache
  191. }
  192. if dec.TrieDirtyCache != nil {
  193. c.TrieDirtyCache = *dec.TrieDirtyCache
  194. }
  195. if dec.TrieTimeout != nil {
  196. c.TrieTimeout = *dec.TrieTimeout
  197. }
  198. if dec.Miner != nil {
  199. c.Miner = *dec.Miner
  200. }
  201. if dec.Ethash != nil {
  202. c.Ethash = *dec.Ethash
  203. }
  204. if dec.TxPool != nil {
  205. c.TxPool = *dec.TxPool
  206. }
  207. if dec.GPO != nil {
  208. c.GPO = *dec.GPO
  209. }
  210. if dec.EnablePreimageRecording != nil {
  211. c.EnablePreimageRecording = *dec.EnablePreimageRecording
  212. }
  213. if dec.DocRoot != nil {
  214. c.DocRoot = *dec.DocRoot
  215. }
  216. if dec.EWASMInterpreter != nil {
  217. c.EWASMInterpreter = *dec.EWASMInterpreter
  218. }
  219. if dec.EVMInterpreter != nil {
  220. c.EVMInterpreter = *dec.EVMInterpreter
  221. }
  222. if dec.RPCGasCap != nil {
  223. c.RPCGasCap = dec.RPCGasCap
  224. }
  225. if dec.Checkpoint != nil {
  226. c.Checkpoint = dec.Checkpoint
  227. }
  228. if dec.CheckpointOracle != nil {
  229. c.CheckpointOracle = dec.CheckpointOracle
  230. }
  231. return nil
  232. }