gen_config.go 8.0 KB

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