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

Function newTestnetGenesisBlock

core/genesis.go:345–371  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

343}
344
345func newTestnetGenesisBlock() *Genesis {
346 candidates := configs.Candidates()
347 return &Genesis{
348 Config: configs.ChainConfigInfo(),
349 Timestamp: 1492009146000,
350 ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000"),
351 GasLimit: configs.DefaultGasLimitPerBlock,
352 Difficulty: big.NewInt(1),
353 Alloc: map[common.Address]GenesisAccount{
354 candidates[0]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
355 candidates[1]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
356 candidates[2]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
357 candidates[3]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
358 candidates[4]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
359 candidates[5]: {Balance: new(big.Int).Mul(big.NewInt(300000), big.NewInt(configs.Cpc))},
360
361 // faucet node
362 common.HexToAddress("0xe83a71428655b9f52ff6dc556e2b37043f39f194"): {Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))},
363 },
364 Dpor: types.DporSnap{
365 Proposers: configs.Proposers(),
366 Seal: types.DporSignature{},
367 Sigs: make([]types.DporSignature, configs.TestnetValidatorsNumber),
368 Validators: configs.Validators(),
369 },
370 }
371}
372
373func newMainnetGenesisBlock() *Genesis {
374 log.Info("newMainnetGenesisBlock runmode:", "vv", configs.GetRunMode())

Callers 1

DefaultGenesisBlockFunction · 0.85

Calls 3

ChainConfigInfoMethod · 0.80
ProposersMethod · 0.65
ValidatorsMethod · 0.65

Tested by

no test coverage detected