github.com/core-coin/go-core/v2@v2.1.9/xcb/gen_config.go (about) 1 // Code generated by github.com/fjl/gencodec. DO NOT EDIT. 2 3 package xcb 4 5 import ( 6 "time" 7 8 "github.com/core-coin/go-core/v2/common" 9 "github.com/core-coin/go-core/v2/consensus/cryptore" 10 "github.com/core-coin/go-core/v2/core" 11 "github.com/core-coin/go-core/v2/miner" 12 "github.com/core-coin/go-core/v2/params" 13 "github.com/core-coin/go-core/v2/xcb/downloader" 14 "github.com/core-coin/go-core/v2/xcb/energyprice" 15 ) 16 17 // MarshalTOML marshals as TOML. 18 func (c Config) MarshalTOML() (interface{}, error) { 19 type Config struct { 20 Genesis *core.Genesis `toml:",omitempty"` 21 NetworkId uint64 22 SyncMode downloader.SyncMode 23 UseDNSDiscovery bool 24 DiscoveryURLs []string 25 NoPruning bool 26 NoPrefetch bool 27 TxLookupLimit uint64 `toml:",omitempty"` 28 Whitelist map[uint64]common.Hash `toml:"-"` 29 LightServ int `toml:",omitempty"` 30 LightIngress int `toml:",omitempty"` 31 LightEgress int `toml:",omitempty"` 32 LightPeers int `toml:",omitempty"` 33 LightNoPrune 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 46 SnapshotCache int 47 Preimages bool 48 Miner miner.Config 49 Cryptore cryptore.Config 50 TxPool core.TxPoolConfig 51 GPO energyprice.Config 52 EnablePreimageRecording bool 53 DocRoot string `toml:"-"` 54 EWASMInterpreter string 55 CVMInterpreter string 56 TrustedPeersBroadcasting bool 57 RPCEnergyCap uint64 `toml:",omitempty"` 58 RPCTxFeeCap float64 `toml:",omitempty"` 59 Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` 60 CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` 61 } 62 var enc Config 63 enc.Genesis = c.Genesis 64 enc.NetworkId = c.NetworkId 65 enc.SyncMode = c.SyncMode 66 enc.UseDNSDiscovery = c.UseDNSDiscovery 67 enc.DiscoveryURLs = c.DiscoveryURLs 68 enc.NoPruning = c.NoPruning 69 enc.NoPrefetch = c.NoPrefetch 70 enc.TxLookupLimit = c.TxLookupLimit 71 enc.Whitelist = c.Whitelist 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.UltraLightServers = c.UltraLightServers 78 enc.UltraLightFraction = c.UltraLightFraction 79 enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce 80 enc.SkipBcVersionCheck = c.SkipBcVersionCheck 81 enc.DatabaseHandles = c.DatabaseHandles 82 enc.DatabaseCache = c.DatabaseCache 83 enc.DatabaseFreezer = c.DatabaseFreezer 84 enc.TrieCleanCache = c.TrieCleanCache 85 enc.TrieCleanCacheJournal = c.TrieCleanCacheJournal 86 enc.TrieCleanCacheRejournal = c.TrieCleanCacheRejournal 87 enc.TrieDirtyCache = c.TrieDirtyCache 88 enc.TrieTimeout = c.TrieTimeout 89 enc.SnapshotCache = c.SnapshotCache 90 enc.Preimages = c.Preimages 91 enc.Miner = c.Miner 92 enc.Cryptore = c.Cryptore 93 enc.TxPool = c.TxPool 94 enc.GPO = c.GPO 95 enc.EnablePreimageRecording = c.EnablePreimageRecording 96 enc.DocRoot = c.DocRoot 97 enc.EWASMInterpreter = c.EWASMInterpreter 98 enc.CVMInterpreter = c.CVMInterpreter 99 enc.TrustedPeersBroadcasting = c.TrustedPeersBroadcasting 100 enc.RPCEnergyCap = c.RPCEnergyCap 101 enc.RPCTxFeeCap = c.RPCTxFeeCap 102 enc.Checkpoint = c.Checkpoint 103 enc.CheckpointOracle = c.CheckpointOracle 104 return &enc, nil 105 } 106 107 // UnmarshalTOML unmarshals from TOML. 108 func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { 109 type Config struct { 110 Genesis *core.Genesis `toml:",omitempty"` 111 NetworkId *uint64 112 SyncMode *downloader.SyncMode 113 UseDNSDiscovery *bool 114 DiscoveryURLs []string 115 NoPruning *bool 116 NoPrefetch *bool 117 TxLookupLimit *uint64 `toml:",omitempty"` 118 Whitelist map[uint64]common.Hash `toml:"-"` 119 LightServ *int `toml:",omitempty"` 120 LightIngress *int `toml:",omitempty"` 121 LightEgress *int `toml:",omitempty"` 122 LightPeers *int `toml:",omitempty"` 123 LightNoPrune *bool `toml:",omitempty"` 124 UltraLightServers []string `toml:",omitempty"` 125 UltraLightFraction *int `toml:",omitempty"` 126 UltraLightOnlyAnnounce *bool `toml:",omitempty"` 127 SkipBcVersionCheck *bool `toml:"-"` 128 DatabaseHandles *int `toml:"-"` 129 DatabaseCache *int 130 DatabaseFreezer *string 131 TrieCleanCache *int 132 TrieCleanCacheJournal *string `toml:",omitempty"` 133 TrieCleanCacheRejournal *time.Duration `toml:",omitempty"` 134 TrieDirtyCache *int 135 TrieTimeout *time.Duration 136 SnapshotCache *int 137 Preimages *bool 138 Miner *miner.Config 139 Cryptore *cryptore.Config 140 TxPool *core.TxPoolConfig 141 GPO *energyprice.Config 142 EnablePreimageRecording *bool 143 DocRoot *string `toml:"-"` 144 EWASMInterpreter *string 145 CVMInterpreter *string 146 TrustedPeersBroadcasting *bool 147 RPCEnergyCap *uint64 `toml:",omitempty"` 148 RPCTxFeeCap *float64 `toml:",omitempty"` 149 Checkpoint *params.TrustedCheckpoint `toml:",omitempty"` 150 CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"` 151 } 152 var dec Config 153 if err := unmarshal(&dec); err != nil { 154 return err 155 } 156 if dec.Genesis != nil { 157 c.Genesis = dec.Genesis 158 } 159 if dec.NetworkId != nil { 160 c.NetworkId = *dec.NetworkId 161 } 162 if dec.SyncMode != nil { 163 c.SyncMode = *dec.SyncMode 164 } 165 if dec.UseDNSDiscovery != nil { 166 c.UseDNSDiscovery = *dec.UseDNSDiscovery 167 } 168 if dec.DiscoveryURLs != nil { 169 c.DiscoveryURLs = dec.DiscoveryURLs 170 } 171 if dec.NoPruning != nil { 172 c.NoPruning = *dec.NoPruning 173 } 174 if dec.NoPrefetch != nil { 175 c.NoPrefetch = *dec.NoPrefetch 176 } 177 if dec.TxLookupLimit != nil { 178 c.TxLookupLimit = *dec.TxLookupLimit 179 } 180 if dec.Whitelist != nil { 181 c.Whitelist = dec.Whitelist 182 } 183 if dec.LightServ != nil { 184 c.LightServ = *dec.LightServ 185 } 186 if dec.LightIngress != nil { 187 c.LightIngress = *dec.LightIngress 188 } 189 if dec.LightEgress != nil { 190 c.LightEgress = *dec.LightEgress 191 } 192 if dec.LightPeers != nil { 193 c.LightPeers = *dec.LightPeers 194 } 195 if dec.LightNoPrune != nil { 196 c.LightNoPrune = *dec.LightNoPrune 197 } 198 if dec.UltraLightServers != nil { 199 c.UltraLightServers = dec.UltraLightServers 200 } 201 if dec.UltraLightFraction != nil { 202 c.UltraLightFraction = *dec.UltraLightFraction 203 } 204 if dec.UltraLightOnlyAnnounce != nil { 205 c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce 206 } 207 if dec.SkipBcVersionCheck != nil { 208 c.SkipBcVersionCheck = *dec.SkipBcVersionCheck 209 } 210 if dec.DatabaseHandles != nil { 211 c.DatabaseHandles = *dec.DatabaseHandles 212 } 213 if dec.DatabaseCache != nil { 214 c.DatabaseCache = *dec.DatabaseCache 215 } 216 if dec.DatabaseFreezer != nil { 217 c.DatabaseFreezer = *dec.DatabaseFreezer 218 } 219 if dec.TrieCleanCache != nil { 220 c.TrieCleanCache = *dec.TrieCleanCache 221 } 222 if dec.TrieCleanCacheJournal != nil { 223 c.TrieCleanCacheJournal = *dec.TrieCleanCacheJournal 224 } 225 if dec.TrieCleanCacheRejournal != nil { 226 c.TrieCleanCacheRejournal = *dec.TrieCleanCacheRejournal 227 } 228 if dec.TrieDirtyCache != nil { 229 c.TrieDirtyCache = *dec.TrieDirtyCache 230 } 231 if dec.TrieTimeout != nil { 232 c.TrieTimeout = *dec.TrieTimeout 233 } 234 if dec.SnapshotCache != nil { 235 c.SnapshotCache = *dec.SnapshotCache 236 } 237 if dec.Preimages != nil { 238 c.Preimages = *dec.Preimages 239 } 240 if dec.Miner != nil { 241 c.Miner = *dec.Miner 242 } 243 if dec.Cryptore != nil { 244 c.Cryptore = *dec.Cryptore 245 } 246 if dec.TxPool != nil { 247 c.TxPool = *dec.TxPool 248 } 249 if dec.GPO != nil { 250 c.GPO = *dec.GPO 251 } 252 if dec.EnablePreimageRecording != nil { 253 c.EnablePreimageRecording = *dec.EnablePreimageRecording 254 } 255 if dec.DocRoot != nil { 256 c.DocRoot = *dec.DocRoot 257 } 258 if dec.EWASMInterpreter != nil { 259 c.EWASMInterpreter = *dec.EWASMInterpreter 260 } 261 if dec.CVMInterpreter != nil { 262 c.CVMInterpreter = *dec.CVMInterpreter 263 } 264 if dec.TrustedPeersBroadcasting != nil { 265 c.TrustedPeersBroadcasting = *dec.TrustedPeersBroadcasting 266 } 267 if dec.RPCEnergyCap != nil { 268 c.RPCEnergyCap = *dec.RPCEnergyCap 269 } 270 if dec.RPCTxFeeCap != nil { 271 c.RPCTxFeeCap = *dec.RPCTxFeeCap 272 } 273 if dec.Checkpoint != nil { 274 c.Checkpoint = dec.Checkpoint 275 } 276 if dec.CheckpointOracle != nil { 277 c.CheckpointOracle = dec.CheckpointOracle 278 } 279 return nil 280 }