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

Feat/chaincmd dumpgenesis #39

Merged
merged 3 commits into from
Dec 16, 2019
Merged

Feat/chaincmd dumpgenesis #39

merged 3 commits into from
Dec 16, 2019

Conversation

meowsbits
Copy link

I have a hard time believing this doesn't already exist... although I could not find it anywhere. @soc1c where/how do you make the configs like https://github.com/etclabscore/mordor/blob/master/mgeth.json ?

If it in fact this command (or an equivalent) doesn't already exist, then we should make this PR to ETH.

  • Write genesis JSON config to stdout.

Use:

$ ./build/bin/geth --classic dumpgenesis 2>/dev/null | jj config -p
{
  "chainId": 61,
  "homesteadBlock": 1150000,
  "eip7FBlock": null,
  "daoForkBlock": 1920000,
  "eip150Block": 2500000,
  "eip150Hash": "0xca12c63534f565899681965528d536c52cb05b7c48e269c2a6cb77ad864d878a",
  "eip155Block": 3000000,
  "eip158Block": 8772000,
  "eip160Block": 3000000,
  "byzantiumBlock": 8772000,
  "ecip1010PauseBlock": 3000000,
  "ecip1010Length": 2000000,
  "ecip1017EraRounds": 5000000,
  "disposalBlock": 5900000,
  "ethash": {},
  "trustedCheckpoint": null,
  "trustedCheckpointOracle": null
}

I have a hard time believing this doesn't already exist...
although I could not find it anywhere.
Seems weird that MakeGenesis method doesn't return
DefaultMainnet...
Copy link

@tzdybal tzdybal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (except one typo)

genesis = core.DefaultGenesisBlock()
}
if err := json.NewEncoder(os.Stdout).Encode(genesis); err != nil {
utils.Fatalf("could not encode defaulty genesis")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
utils.Fatalf("could not encode defaulty genesis")
utils.Fatalf("could not encode default genesis")

Copy link
Author

@meowsbits meowsbits Oct 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made default into an adjective because there are more than one 'default' genes_es_ available... so 'could not encode default genesis' implies that it failed to encode the genesis, while in fact it failed with all/any of them...

EDIT
...so 'could not encode a default genesis' would be maybe a better way of saying this...

cmd/geth/chaincmd.go Outdated Show resolved Hide resolved
Copy link

@tzdybal tzdybal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@soc1c
Copy link

soc1c commented Oct 21, 2019

Jupp, @meowsbits, this was a unique feature for geth classic. I manually crafted the spec you linked above.

I'm supporting this PR but would also encourage to move forward with actual chain specs just like parity or classic geth do.

@meowsbits
Copy link
Author

Made upstream, ethereum/go-ethereum#20191

@soc1c soc1c merged commit 1aeba62 into master Dec 16, 2019
@soc1c soc1c deleted the feat/chaincmd-dumpgenesis branch December 16, 2019 09:31
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

Successfully merging this pull request may close these issues.

3 participants