question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accept a genesis.json file

See original GitHub issue

The genesis.json file format specifies an initial state for the blockchain, including balances of account numbers.

This could be very useful for development environments where a client has a wallet on it, and we want them to have a balance even on the simulated blockchain.

Lets clients operate in the development environment with nothing but the RPC address and an account that they’ve generated.

(I’m talking about Metamask here).

sample genesis.json here.

The basic format is this:

{
"nonce": "0x0000000000000042",
"difficulty": "0x400000000",
"alloc": {
  "3282791d6fd713f1e94f4bfd565eaa78b3a0599d": {
    "balance": "1337000000000000000000"
    }
  },
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
"gasLimit": "0x1388"
}

The part I care the most about is the alloc hash, which includes a map of accounts to an object containing their initial balance.

An aside: A lot of pre-sale purchasers picked 1337... as their initial balance 😃

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:10
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
zcstarrcommented, Nov 26, 2019

Going to just ping this here, I think this is still a good idea 👍 , is there any major blocker to this?

1reaction
john-osullivancommented, Dec 7, 2018

Is anyone trying to work on this? I’m in the scenario described by @aakilfernandes , trying to test a pre-deployed contract. Having to spin up a real chain each time is a pain!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Beginners guide to Ethereum (3) — explain the genesis file ...
This tutorial serves as a complete guide that combines all the information you will need about a genesis file, including some of the...
Read more >
Genesis JSON - Klaytn Docs
Genesis JSON File Structure ; coinbase. An address to which miner receives the reward. This field is only used for Clique consensus engine....
Read more >
Create a genesis file - GoQuorum - 22.7.0 - ConsenSys
Configuring a network using a genesis file. ... Create a JSON genesis file, then specify the genesis file when initalizing GoQuorum with:.
Read more >
What does each genesis.json parameter mean?
mixhash: What is this? coinbase: Ethereum address for coinbase, right? alloc: first ether allocation. Sample genesis json file from How To ...
Read more >
Tutorial: Operating a Private Network - CoreGeth Documentation
First, you'll need to create the genesis state of your networks, which all nodes need to be aware of and agree upon. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found