gen_config.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. // Code generated by github.com/fjl/gencodec. DO NOT EDIT.
  2. package ethconfig
  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. EthDiscoveryURLs []string
  21. SnapDiscoveryURLs []string
  22. NoPruning bool
  23. NoPrefetch bool
  24. TxLookupLimit uint64 `toml:",omitempty"`
  25. RequiredBlocks map[uint64]common.Hash `toml:"-"`
  26. LightServ int `toml:",omitempty"`
  27. LightIngress int `toml:",omitempty"`
  28. LightEgress int `toml:",omitempty"`
  29. LightPeers int `toml:",omitempty"`
  30. LightNoPrune bool `toml:",omitempty"`
  31. LightNoSyncServe bool `toml:",omitempty"`
  32. SyncFromCheckpoint bool `toml:",omitempty"`
  33. UltraLightServers []string `toml:",omitempty"`
  34. UltraLightFraction int `toml:",omitempty"`
  35. UltraLightOnlyAnnounce bool `toml:",omitempty"`
  36. SkipBcVersionCheck bool `toml:"-"`
  37. DatabaseHandles int `toml:"-"`
  38. DatabaseCache int
  39. DatabaseFreezer string
  40. TrieCleanCache int
  41. TrieCleanCacheJournal string `toml:",omitempty"`
  42. TrieCleanCacheRejournal time.Duration `toml:",omitempty"`
  43. TrieDirtyCache int
  44. TrieTimeout time.Duration
  45. SnapshotCache int
  46. Preimages bool
  47. FilterLogCacheSize int
  48. Miner miner.Config
  49. Ethash ethash.Config
  50. TxPool core.TxPoolConfig
  51. GPO gasprice.Config
  52. EnablePreimageRecording bool
  53. DocRoot string `toml:"-"`
  54. RPCGasCap uint64
  55. RPCEVMTimeout time.Duration
  56. RPCTxFeeCap float64
  57. Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
  58. CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
  59. OverrideTerminalTotalDifficulty *big.Int `toml:",omitempty"`
  60. OverrideTerminalTotalDifficultyPassed *bool `toml:",omitempty"`
  61. }
  62. var enc Config
  63. enc.Genesis = c.Genesis
  64. enc.NetworkId = c.NetworkId
  65. enc.SyncMode = c.SyncMode
  66. enc.EthDiscoveryURLs = c.EthDiscoveryURLs
  67. enc.SnapDiscoveryURLs = c.SnapDiscoveryURLs
  68. enc.NoPruning = c.NoPruning
  69. enc.NoPrefetch = c.NoPrefetch
  70. enc.TxLookupLimit = c.TxLookupLimit
  71. enc.RequiredBlocks = c.RequiredBlocks
  72. enc.LightServ = c.LightServ
  73. enc.LightIngress = c.LightIngress
  74. enc.LightEgress = c.LightEgress
  75. enc.LightPeers = c.LightPeers
  76. enc.LightNoPrune = c.LightNoPrune
  77. enc.LightNoSyncServe = c.LightNoSyncServe
  78. enc.SyncFromCheckpoint = c.SyncFromCheckpoint
  79. enc.UltraLightServers = c.UltraLightServers
  80. enc.UltraLightFraction = c.UltraLightFraction
  81. enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce
  82. enc.SkipBcVersionCheck = c.SkipBcVersionCheck
  83. enc.DatabaseHandles = c.DatabaseHandles
  84. enc.DatabaseCache = c.DatabaseCache
  85. enc.DatabaseFreezer = c.DatabaseFreezer
  86. enc.TrieCleanCache = c.TrieCleanCache
  87. enc.TrieCleanCacheJournal = c.TrieCleanCacheJournal
  88. enc.TrieCleanCacheRejournal = c.TrieCleanCacheRejournal
  89. enc.TrieDirtyCache = c.TrieDirtyCache
  90. enc.TrieTimeout = c.TrieTimeout
  91. enc.SnapshotCache = c.SnapshotCache
  92. enc.Preimages = c.Preimages
  93. enc.FilterLogCacheSize = c.FilterLogCacheSize
  94. enc.Miner = c.Miner
  95. enc.Ethash = c.Ethash
  96. enc.TxPool = c.TxPool
  97. enc.GPO = c.GPO
  98. enc.EnablePreimageRecording = c.EnablePreimageRecording
  99. enc.DocRoot = c.DocRoot
  100. enc.RPCGasCap = c.RPCGasCap
  101. enc.RPCEVMTimeout = c.RPCEVMTimeout
  102. enc.RPCTxFeeCap = c.RPCTxFeeCap
  103. enc.Checkpoint = c.Checkpoint
  104. enc.CheckpointOracle = c.CheckpointOracle
  105. enc.OverrideTerminalTotalDifficulty = c.OverrideTerminalTotalDifficulty
  106. enc.OverrideTerminalTotalDifficultyPassed = c.OverrideTerminalTotalDifficultyPassed
  107. return &enc, nil
  108. }
  109. // UnmarshalTOML unmarshals from TOML.
  110. func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
  111. type Config struct {
  112. Genesis *core.Genesis `toml:",omitempty"`
  113. NetworkId *uint64
  114. SyncMode *downloader.SyncMode
  115. EthDiscoveryURLs []string
  116. SnapDiscoveryURLs []string
  117. NoPruning *bool
  118. NoPrefetch *bool
  119. TxLookupLimit *uint64 `toml:",omitempty"`
  120. RequiredBlocks map[uint64]common.Hash `toml:"-"`
  121. LightServ *int `toml:",omitempty"`
  122. LightIngress *int `toml:",omitempty"`
  123. LightEgress *int `toml:",omitempty"`
  124. LightPeers *int `toml:",omitempty"`
  125. LightNoPrune *bool `toml:",omitempty"`
  126. LightNoSyncServe *bool `toml:",omitempty"`
  127. SyncFromCheckpoint *bool `toml:",omitempty"`
  128. UltraLightServers []string `toml:",omitempty"`
  129. UltraLightFraction *int `toml:",omitempty"`
  130. UltraLightOnlyAnnounce *bool `toml:",omitempty"`
  131. SkipBcVersionCheck *bool `toml:"-"`
  132. DatabaseHandles *int `toml:"-"`
  133. DatabaseCache *int
  134. DatabaseFreezer *string
  135. TrieCleanCache *int
  136. TrieCleanCacheJournal *string `toml:",omitempty"`
  137. TrieCleanCacheRejournal *time.Duration `toml:",omitempty"`
  138. TrieDirtyCache *int
  139. TrieTimeout *time.Duration
  140. SnapshotCache *int
  141. Preimages *bool
  142. FilterLogCacheSize *int
  143. Miner *miner.Config
  144. Ethash *ethash.Config
  145. TxPool *core.TxPoolConfig
  146. GPO *gasprice.Config
  147. EnablePreimageRecording *bool
  148. DocRoot *string `toml:"-"`
  149. RPCGasCap *uint64
  150. RPCEVMTimeout *time.Duration
  151. RPCTxFeeCap *float64
  152. Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
  153. CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
  154. OverrideTerminalTotalDifficulty *big.Int `toml:",omitempty"`
  155. OverrideTerminalTotalDifficultyPassed *bool `toml:",omitempty"`
  156. }
  157. var dec Config
  158. if err := unmarshal(&dec); err != nil {
  159. return err
  160. }
  161. if dec.Genesis != nil {
  162. c.Genesis = dec.Genesis
  163. }
  164. if dec.NetworkId != nil {
  165. c.NetworkId = *dec.NetworkId
  166. }
  167. if dec.SyncMode != nil {
  168. c.SyncMode = *dec.SyncMode
  169. }
  170. if dec.EthDiscoveryURLs != nil {
  171. c.EthDiscoveryURLs = dec.EthDiscoveryURLs
  172. }
  173. if dec.SnapDiscoveryURLs != nil {
  174. c.SnapDiscoveryURLs = dec.SnapDiscoveryURLs
  175. }
  176. if dec.NoPruning != nil {
  177. c.NoPruning = *dec.NoPruning
  178. }
  179. if dec.NoPrefetch != nil {
  180. c.NoPrefetch = *dec.NoPrefetch
  181. }
  182. if dec.TxLookupLimit != nil {
  183. c.TxLookupLimit = *dec.TxLookupLimit
  184. }
  185. if dec.RequiredBlocks != nil {
  186. c.RequiredBlocks = dec.RequiredBlocks
  187. }
  188. if dec.LightServ != nil {
  189. c.LightServ = *dec.LightServ
  190. }
  191. if dec.LightIngress != nil {
  192. c.LightIngress = *dec.LightIngress
  193. }
  194. if dec.LightEgress != nil {
  195. c.LightEgress = *dec.LightEgress
  196. }
  197. if dec.LightPeers != nil {
  198. c.LightPeers = *dec.LightPeers
  199. }
  200. if dec.LightNoPrune != nil {
  201. c.LightNoPrune = *dec.LightNoPrune
  202. }
  203. if dec.LightNoSyncServe != nil {
  204. c.LightNoSyncServe = *dec.LightNoSyncServe
  205. }
  206. if dec.SyncFromCheckpoint != nil {
  207. c.SyncFromCheckpoint = *dec.SyncFromCheckpoint
  208. }
  209. if dec.UltraLightServers != nil {
  210. c.UltraLightServers = dec.UltraLightServers
  211. }
  212. if dec.UltraLightFraction != nil {
  213. c.UltraLightFraction = *dec.UltraLightFraction
  214. }
  215. if dec.UltraLightOnlyAnnounce != nil {
  216. c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce
  217. }
  218. if dec.SkipBcVersionCheck != nil {
  219. c.SkipBcVersionCheck = *dec.SkipBcVersionCheck
  220. }
  221. if dec.DatabaseHandles != nil {
  222. c.DatabaseHandles = *dec.DatabaseHandles
  223. }
  224. if dec.DatabaseCache != nil {
  225. c.DatabaseCache = *dec.DatabaseCache
  226. }
  227. if dec.DatabaseFreezer != nil {
  228. c.DatabaseFreezer = *dec.DatabaseFreezer
  229. }
  230. if dec.TrieCleanCache != nil {
  231. c.TrieCleanCache = *dec.TrieCleanCache
  232. }
  233. if dec.TrieCleanCacheJournal != nil {
  234. c.TrieCleanCacheJournal = *dec.TrieCleanCacheJournal
  235. }
  236. if dec.TrieCleanCacheRejournal != nil {
  237. c.TrieCleanCacheRejournal = *dec.TrieCleanCacheRejournal
  238. }
  239. if dec.TrieDirtyCache != nil {
  240. c.TrieDirtyCache = *dec.TrieDirtyCache
  241. }
  242. if dec.TrieTimeout != nil {
  243. c.TrieTimeout = *dec.TrieTimeout
  244. }
  245. if dec.SnapshotCache != nil {
  246. c.SnapshotCache = *dec.SnapshotCache
  247. }
  248. if dec.Preimages != nil {
  249. c.Preimages = *dec.Preimages
  250. }
  251. if dec.FilterLogCacheSize != nil {
  252. c.FilterLogCacheSize = *dec.FilterLogCacheSize
  253. }
  254. if dec.Miner != nil {
  255. c.Miner = *dec.Miner
  256. }
  257. if dec.Ethash != nil {
  258. c.Ethash = *dec.Ethash
  259. }
  260. if dec.TxPool != nil {
  261. c.TxPool = *dec.TxPool
  262. }
  263. if dec.GPO != nil {
  264. c.GPO = *dec.GPO
  265. }
  266. if dec.EnablePreimageRecording != nil {
  267. c.EnablePreimageRecording = *dec.EnablePreimageRecording
  268. }
  269. if dec.DocRoot != nil {
  270. c.DocRoot = *dec.DocRoot
  271. }
  272. if dec.RPCGasCap != nil {
  273. c.RPCGasCap = *dec.RPCGasCap
  274. }
  275. if dec.RPCEVMTimeout != nil {
  276. c.RPCEVMTimeout = *dec.RPCEVMTimeout
  277. }
  278. if dec.RPCTxFeeCap != nil {
  279. c.RPCTxFeeCap = *dec.RPCTxFeeCap
  280. }
  281. if dec.Checkpoint != nil {
  282. c.Checkpoint = dec.Checkpoint
  283. }
  284. if dec.CheckpointOracle != nil {
  285. c.CheckpointOracle = dec.CheckpointOracle
  286. }
  287. if dec.OverrideTerminalTotalDifficulty != nil {
  288. c.OverrideTerminalTotalDifficulty = dec.OverrideTerminalTotalDifficulty
  289. }
  290. if dec.OverrideTerminalTotalDifficultyPassed != nil {
  291. c.OverrideTerminalTotalDifficultyPassed = dec.OverrideTerminalTotalDifficultyPassed
  292. }
  293. return nil
  294. }