Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genesis creation #91

Open
jayeshbairagi opened this issue Dec 4, 2019 · 0 comments
Open

Genesis creation #91

jayeshbairagi opened this issue Dec 4, 2019 · 0 comments
Labels

Comments

@jayeshbairagi
Copy link
Collaborator

A tool should read the core contract and generate a genesis file. This tool can use a genesis file template and update the following values:

  • metachainId
  • timestamp
  • extraData
  • initial balance for validators
  • precompiled code
    The address of the precompiled contracts can be determined
    0x0000000000000000000000000000000000000000000000000000000000004D<00-ff>
{
  "number": "0x0",
  "config": {
    "chainId": < metachainid >, 
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "clique": {
      "period": 3,
      "epoch": 30000
    }
  },
  "nonce": "0x0",
  "timestamp": "< time stamp from block header of rootOriginObservationBlockHeight>",
  "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000< all validator addresses >0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0x989680",
  "difficulty": "0x1",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "alloc": {
    "0000000000000000000000000000000000000000": {      
      "balance": "< very large number >",
      "code": "0xcodeofUTmOST",
      "nonce": "1",
      "storage": {
        "0x0000000000000000000000000000000000000000000000000000000000000000":" < some value>",
        "0x0000000000000000000000000000000000000000000000000000000000000001":" < some value >"
      }
    },
    "< validator addresss 1 >": {
      "balance": "< Staked amount address >"
    },
    "< validator addresss 2 >": {
      "balance": "< Staked amount address >"
    },
    "0000000000000000000000000000000000000000000000000000000000004D<00-ff>": {
      "balance": "0",
      "code": "< contract code >"
      "nonce": "1",
      "storage": {
        "0x0000000000000000000000000000000000000000000000000000000000000000":" < some value>",
        "0x0000000000000000000000000000000000000000000000000000000000000001":" < some value >"
    }
  },
  "gasUsed": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}        
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant