gen_config.go 6.9 KB

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