gen_config.go 11 KB

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