genesis.go 978 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package core
  2. import (
  3. "math/big"
  4. "github.com/ethereum/go-ethereum/crypto"
  5. "github.com/ethereum/go-ethereum/ethutil"
  6. )
  7. /*
  8. * This is the special genesis block.
  9. */
  10. var ZeroHash256 = make([]byte, 32)
  11. var ZeroHash160 = make([]byte, 20)
  12. var ZeroHash512 = make([]byte, 64)
  13. var EmptyShaList = crypto.Sha3(ethutil.Encode([]interface{}{}))
  14. var EmptyListRoot = crypto.Sha3(ethutil.Encode(""))
  15. var GenesisHeader = []interface{}{
  16. // Previous hash (none)
  17. ZeroHash256,
  18. // Empty uncles
  19. EmptyShaList,
  20. // Coinbase
  21. ZeroHash160,
  22. // Root state
  23. EmptyShaList,
  24. // tx root
  25. EmptyListRoot,
  26. // receipt root
  27. EmptyListRoot,
  28. // bloom
  29. ZeroHash512,
  30. // Difficulty
  31. //ethutil.BigPow(2, 22),
  32. big.NewInt(131072),
  33. // Number
  34. ethutil.Big0,
  35. // Block upper gas bound
  36. big.NewInt(1000000),
  37. // Block gas used
  38. ethutil.Big0,
  39. // Time
  40. ethutil.Big0,
  41. // Extra
  42. nil,
  43. // Nonce
  44. crypto.Sha3(big.NewInt(42).Bytes()),
  45. }
  46. var Genesis = []interface{}{GenesisHeader, []interface{}{}, []interface{}{}}