gen_config.go 7.5 KB

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