MCPcopy Create free account
hub / github.com/CPChain/chain / newMainnetGenesisBlock

Function newMainnetGenesisBlock

core/genesis.go:373–409  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

371}
372
373func newMainnetGenesisBlock() *Genesis {
374 log.Info("newMainnetGenesisBlock runmode:", "vv", configs.GetRunMode())
375 candidates := configs.Candidates()
376 return &Genesis{
377 Config: configs.ChainConfigInfo(),
378 Timestamp: 1553754594000,
379 ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000"),
380 GasLimit: configs.DefaultGasLimitPerBlock,
381 Difficulty: big.NewInt(1),
382 Alloc: map[common.Address]GenesisAccount{
383 candidates[0]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
384 candidates[1]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
385 candidates[2]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
386 candidates[3]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
387 candidates[4]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
388 candidates[5]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
389
390 candidates[6]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
391 candidates[7]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
392 candidates[8]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
393 candidates[9]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
394 candidates[10]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
395 candidates[11]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
396
397 // contract admin account 21
398 common.HexToAddress("0x66961306fd78d39a4604167f59b25697bdad05c5"): {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
399 // bank 22
400 common.HexToAddress("0xfc1e61c396c6e02f0dc06bbbe5ee41a97b05b6fd"): {Balance: new(big.Int).Mul(big.NewInt(873880028800), big.NewInt(configs.Finney))},
401 },
402 Dpor: types.DporSnap{
403 Proposers: configs.Proposers(),
404 Seal: types.DporSignature{},
405 Sigs: make([]types.DporSignature, configs.MainnetValidatorsNumber),
406 Validators: configs.Validators(),
407 },
408 }
409}
410
411func newTestMainnetGenesisBlock() *Genesis {
412 log.Info("newTestMainnetGenesisBlock runmode:", "vv", configs.GetRunMode())

Callers 2

TestGenesisAllocFunction · 0.85
DefaultGenesisBlockFunction · 0.85

Calls 4

ChainConfigInfoMethod · 0.80
InfoMethod · 0.65
ProposersMethod · 0.65
ValidatorsMethod · 0.65

Tested by 1

TestGenesisAllocFunction · 0.68