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

geth init custom-genesis.json fails #14356

Closed
whysoserious opened this issue Apr 20, 2017 · 2 comments
Closed

geth init custom-genesis.json fails #14356

whysoserious opened this issue Apr 20, 2017 · 2 comments
Assignees
Milestone

Comments

@whysoserious
Copy link

whysoserious commented Apr 20, 2017

Probably duplicate of #14352

System information

Geth
Version: 1.6.0-stable
Git Commit: facc47c
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.8.1
Operating System: darwin
GOPATH=/Users/jan/Dev/go/
GOROOT=/usr/local/Cellar/go/1.8.1/libexec

Expected behaviour

geth should initialize a private testnet using custom genesis file from README.md.

Actual behaviour

geth init CustomGenesis.json returns an error.

Steps to reproduce the behaviour

  • In an empty directory create a file CustomGenesis.json with data copied from README.md:
{
  "alloc"      : {},
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x20000",
  "extraData"  : "",
  "gasLimit"   : "0x2fefd8",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}
  • Run geth init CustomGenesis.json.
  • Observe the errors.

Backtrace

$ geth init CustomGenesis.json 
WARN [04-20|10:51:04] No etherbase set and no accounts found as default 
INFO [04-20|10:51:04] Allocated cache and file handles         database=/Users/jan/Library/Ethereum/geth/chaindata cache=128 handles=1024
Fatal: failed to write genesis block: genesis has no chain configuration
@karalabe
Copy link
Member

You need to specify a config field in the genesis json which defines the protocol rules. Such as

    "config": {
        "chainId": 987654321,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },

https://github.com/ethereum/go-ethereum/wiki/Private-network#creating-the-genesis-block.

The README should definitely be updated. I'll leave this issue open until then.

@karalabe karalabe added this to the 1.6.1 milestone Apr 20, 2017
nnn-gif added a commit to nnn-gif/go-ethereum that referenced this issue Apr 24, 2017
u2 added a commit to cryptape/ethereum-bootstrap that referenced this issue May 9, 2017
timhovius added a commit to timhovius/CreatePrivateEthereum that referenced this issue May 11, 2017
@fjl
Copy link
Contributor

fjl commented Sep 10, 2017

It's present in README now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants