Run as follows:
$ python mk_genesis_block.py --extradata <hash_from_#1028201> > genesis.json
The cli docs say I should experiment on my own private test chain so I can easily mine.
They link to this blog post which only has instructions for generating the real genesis block.
I asked on IRC and azariah said I should use this but change the block difficulty.
Do I really need to fetch real network transactions to construct a test chain genesis block?
When I run
python2 ./mk_genesis_block.py --extradata 0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa
in the go-ethereum directory and then attempt to load the json file using
build/bin/geth --genesis /path/to/file
it returns
I0730 16:54:46.675211 17367 backend.go:289] Protocol Versions: [61 60], Network Id: 1
Fatal: unexpected end of JSON input
Does anyone know what's causing this or how it can be fixed?
The script works fine on Linux, but fails on Windows (I just used a random block hash)
C:\ethereum\make-genesis>python mk_genesis_block.py --extradata 0x675f8203a6fc688c0f45ecd52a02ee9d84dfe1b039671dcdf389d4ccf7a5dbd0 > genesis_block.json
Fetching more transactions... 50
Fetching more transactions... 100
Fetching more transactions... 150
[......]
Fetching more transactions... 9400
Fetching more transactions... 9450
Fetching more transactions... 9500
Fetching more transactions... 9550
Gathered history: 9012
Processed transactions: 20
Processed transactions: 40
Processed transactions: 60
Processed transactions: 80
Processed transactions: 100
[......]
Processed transactions: 1140
Processed transactions: 1160
Processed transactions: 1180
Processed transactions: 1200
Bad tx found (genesis output index not zero): 79a554739734b70ed834281d72a00006e576c645b486855b601257abdf3bdb75
Processed transactions: 1219
Processed transactions: 1239
Processed transactions: 1259
Processed transactions: 1279
Processed transactions: 1299
[......]
Processed transactions: 2859
Processed transactions: 2879
Processed transactions: 2899
Processed transactions: 2919
Bad tx found (genesis output index not zero): 1720d776ff374d6be4ea726f0b67f5024bcb5ebfc0fe19af50a6bedcdb4f32d2
Processed transactions: 2938
Processed transactions: 2958
Processed transactions: 2978
Processed transactions: 2998
Processed transactions: 3018
[......]
Processed transactions: 4118
Processed transactions: 4138
Processed transactions: 4158
Processed transactions: 4178
Bad tx found (genesis output index not zero): 3545933ca0510a20dacf1d0bea3c7bc3e2489642177a53c52981414cc910144d
Processed transactions: 4197
Processed transactions: 4217
Processed transactions: 4237
Processed transactions: 4257
Processed transactions: 4277
[......]
Processed transactions: 7717
Processed transactions: 7737
Processed transactions: 7757
Processed transactions: 7777
Bad tx found (genesis output index not zero): 8663b52719fa852c16331accc622f01a160d11da69f5840f2327aaa49878b3ab
Processed transactions: 7796
Processed transactions: 7816
Processed transactions: 7836
[......]
Processed transactions: 8956
Processed transactions: 8976
Processed transactions: 8996
Processed transactions: 9008
Gathered txs and heights
Bad tx found (insufficient value): f22b3fe49d7a110c4fba4361a87fdd8f88b232ecb35a0745b722c7454c026c2a
Bad tx found (insufficient value): fac5d54ea05a6546aed6cd2d5109780d42f900c5dd13a25f37911cf348afeeaf
Bad tx found (insufficient value): a4f992e56d2ff229adec52462645ae0655d54e34fcfe82a045bf3203fc3cff3b
Bad tx found (insufficient value): 103fd529135a990c207c9c89eca1df10695fd676eb10012762f4b86cb618d983
Bad tx found (insufficient value): 78c9dbf496cfb8360b7d7383f473ea75d4f788122f00667f243cd41f392d2ddf
Bad tx found (insufficient value): e85316cdecbf85408b48ab4bc786e7c19af998dee3daf1b82c39377a8afa366e
Bad tx found (insufficient value): 2a1bd037a2f01306ff69257a0bb7222b72b67ca5c7eb7deea4b7df478987f6e8
Bad tx found (insufficient value): 87b098632982a5c4086bbf806ffabb38171212533547ec925b37d37e35cc2963
Bad tx found (single output): 68ffd92d90a79b13b30f2fa97ae5c4089aca5a4b62b5300b4d8100e544c6f0d5
Bad tx found (insufficient value): 303952c770a11d78d17c97d28e83fd7b566900b90bca7e1334babba467fb843a
Bad tx found (insufficient value): a0e33074b806ff10d8b63255ce43b451751742007298fb45deffb31ad4bcfebb
Bad tx found (insufficient value): 9e2e19f19e55d0e2b6681d73cd5b374fc96e358dda37e0e89c95259a439d343f
Bad tx found (insufficient value): 1afad5f2683bde98ab7587d05abc09e9f2f41e2de243eaa8af31f02113c90cee
Bad tx found (insufficient value): 4b868f945476470a575413ea3f0b549f88fa005fd348f3d55d83a4f2b76ec145
Bad tx found (insufficient value): 8b7f5e0cddbed9a2cf3c694242ba22ce0b86ac02de029f15b13e309673eba744
Bad tx found (insufficient value): aac6464a943b8a3e0c0a83b3d4fc89ccaf4d2834b0e625b9e63bebc168f72a5f
Bad tx found (insufficient value): 7faafb670c3d5093dd8fc33e6318fb43371f89784d3c89364e3aa9756bdbec0a
Bad tx found (insufficient value): 15d51dfcb5858059128bd5ab8ac1677a772962cdeee156e85d50beaa100ce773
Bad tx found (insufficient value): 910396b5871e8847ce3a970583c60266a38fcb72656382c541043c9816abb85b
Bad tx found (insufficient value): 5513be5a84ebbcd8faf434198fdb1e90bd406db9bebfd488de86060c2b89c86f
Bad tx found (insufficient value): 8d9ef866e0b2926cbb3cbf3cb16230096ab0f3e74ec2b4ee39839a21dd4d5a0a
Bad tx found (insufficient value): 38dd77196e8e1eb3202e38a357b1acd90a11231c75067c9f9f8257a170dbb269
Bad tx found (insufficient value): 8a42a9063572c70141035fe0859cadb69d8e89ffa7df2d211d710df20abedc33
Bad tx found (insufficient value): 858575f72c333218effd0174e7f4baebe1db513043d33bb5f00c25e5575bcc5d
Bad tx found (insufficient value): 02150a031e86bd42d3659c0a7a3e1187a6c592370c5a82f65dd68168ede0523e
Bad tx found (insufficient value): 7a42bdbbafdb08ec0d2e625eb6b797af5e256e8fa0a20d83b96f99025306e251
Bad tx found (insufficient value): a805ed31ebdcf6ac75e45fd599271449cda92fbae391ce27339b49ee3a898544
Bad tx found (insufficient value): 5dee64116f78e4516ac61c4094a5165f6c2b855a74fda4fc6f884c3fcba3aa8d
Bad tx found (insufficient value): 3a63c41fab284c6f58a79d7d5fd8949a903a47a5cdc6d0c8ace224b3028afa77
Bad tx found (insufficient value): 747cf7e5a326ac2b6d44cf4a88c305b6edc2ef6aab521d81bbecf702831cd343
Bad tx found (insufficient value): bd0fc0aa53d96a229327b2738f484eea22b412c37c6dcc15680497262771576c
Bad tx found (insufficient value): d0b4a1fc977118bcd89b40f5f9ea3fed9effa72d341e5be8045bdf06a09ff5c2
Bad tx found (insufficient value): 3948a58615534335306efcef5b7e0865969a658a0ec006cd3b28f8e2c88b3f77
Bad tx found (insufficient value): 3e1a7b424dabacd5b67bac7308f4f23f4c6a11c3681f20401a1a07a9556c09d2
Bad tx found (insufficient value): ce474a3f0fe93b10d8fe144b32835a1f584290c1fd0fe02b6eb949f36ffb9ffa
Bad tx found (insufficient value): abc8ad3c8f2dc817800f6bdfdd850fc1652c6e8839753b0fdd009f18f9ef17e8
Bad tx found (insufficient value): f3aa0680665fb14622abd37afcaf365af3964a49dec68b5366d5bcba460d8167
Bad tx found (insufficient value): 25e1e8ec1b28136bbe42c99ec8f5da4a454d17bf1698d860ed28bb7ec511705b
Bad tx found (insufficient value): 05311bc7a272d1d382c4af3432f991b5fefa5768f7ecc6cb3c2c796277a4f2fa
Bad tx found (insufficient value): fce0cf89fe07216b01fc3005844e04c191c740baf39cd6b9cb1f84c9f0bfeb91
Bad tx found (insufficient value): 393e3bdb4f91a21b3f53906485ad3e71f973a3e07f3e47dd256cb2beb5bb2e61
Bad tx found (insufficient value): 46a20da936d36f698664e85fffdee7fe60fc99e479d2572380cc9e09c52b29d7
Bad tx found (insufficient value): efc5a6afd26f42bd45672118d579f35a4e56015803a82a4518de01d6b5ceaf8b
Bad tx found (insufficient value): 61d6a414a5c683465785c77e306a9ae11a72334a97977784013c32ddc0207c04
Bad tx found (insufficient value): f1bae4c63788e3eb115323b698dd0106c02f28e91edbc8739fecd391516c3979
Bad tx found (insufficient value): c8f4faab93e8e8200832d98b7457e2d78b634c1b84e47c11d1adbecdbed0bc8f
Bad tx found (insufficient value): a9cd7a0535923fa2959244b62c0ec4987d8c44e2044565628d2b29a9301b27d6
Bad tx found (insufficient value): c8822e707cbda2dbc53f098c8f0d11940c6f392ab336711304a2eb78410eef13
Bad tx found (insufficient value): e8895ba6b76a27add85b68e447c191f3ec759b16e57248ecd61b0c5c741790f1
Bad tx found (insufficient value): 1b218afad88b14ab33ea63a4c3d05b70918258cdde9fbf2cbdef394730cb69f1
Bad tx found (insufficient value): add47b60d330f11015fbc099038b919e37a5d3629d77069378d237e091f16668
Bad tx found (insufficient value): 64f4904f654437b51e8a8a90fbaa660dcf5fbfc1fe3a4b95bc2576e350a726e4
Bad tx found (insufficient value): d19bdf3620e36e3de3d9b62341f296112199eeaee234df5aa9cf840e4d5c5890
Bad tx found (insufficient value): 4ae5d706abd27200d99cdeb313ca2a9e804568c1479e2a698c70bf5108ce8318
Bad tx found (insufficient value): c607161264b5d0bbe4b58f8dfadeb4f004a796f759468e25b00cf5dc7200c75f
Bad tx found (insufficient value): 77c5798f71b18117c643173dfa89fbc1f27e1f0679cde2dbaa178f6c3380d382
Bad tx found (insufficient value): b204f4bfd140bc4d73bca07715cca6b3cb0362664c4026e51e0607e7f90cb477
Bad tx found (insufficient value): 47b58a63be196dd3a88c1a8a5dc61826ec3878f308c753cf134090a2c59aa557
Bad tx found (insufficient value): 42f9228e2d8eabdcc1415f88e8a154a33eb3714348141c5cb2dcd08bf6172d05
Gathered outputs, collecting block timestamps
Collected timestamps: 20
Collected timestamps: 40
Collected timestamps: 60
Collected timestamps: 80
Collected timestamps: 100
[......]
Collected timestamps: 2380
Collected timestamps: 2400
Collected timestamps: 2420
Traceback (most recent call last):
File "mk_genesis_block.py", line 279, in <module>
print json.dumps(evaluate(), indent=4)
File "mk_genesis_block.py", line 271, in evaluate
p = list_purchases(th)
File "mk_genesis_block.py", line 210, in list_purchases
t = get_block_timestamp([x['height'] - 1 for x in subpq])
File "mk_genesis_block.py", line 141, in new_method
c[str(arg)] = method(arg)
File "C:\Python27\lib\site-packages\bitcoin\bci.py", line 416, in get_block_timestamp
"%Y-%m-%dT%H:%M:%SZ")) for x in k['data']}
TypeError: 'NoneType' object is not iterable
Second time around and any attempt after that it fails at
[......]
Collected timestamps: 8380
Collected timestamps: 8400
Collected timestamps: 8420
Traceback (most recent call last):
File "mk_genesis_block.py", line 279, in <module>
print json.dumps(evaluate(), indent=4)
File "mk_genesis_block.py", line 271, in evaluate
p = list_purchases(th)
File "mk_genesis_block.py", line 210, in list_purchases
t = get_block_timestamp([x['height'] - 1 for x in subpq])
File "mk_genesis_block.py", line 141, in new_method
c[str(arg)] = method(arg)
File "C:\Python27\lib\site-packages\bitcoin\bci.py", line 416, in get_block_timestamp
"%Y-%m-%dT%H:%M:%SZ")) for x in k['data']}
TypeError: 'NoneType' object is not iterable
Finally after switching from the 32-bit installer to the 64-bit installer, the process finally continued
Finished, total purchased: 60108506260000000000000000
Foundation wallet creator address: 5abfec25f74cd88437631a7731906932776356f9
Foundation balance: 11901484239480000000000000
However throwing away the cache and restarting the process with Python 2.7 64-bit, a similar error occurs while processing transactions. Retried it a couple of times and got the same result. Then after waiting 5 minutes and trying again, it finally worked with the result as mentioned above.
A small side-note:
The final result is 1,037,541 bytes (MD5: 29B20905BD3796E95A1FEB3F83FADEA6)
Whereas the result on Linux is 1,010,850 bytes (MD5: 9E1DA9D4BCA3773B1501C871D36731F4)
@vbuterin's question on line 30 has a false premise.
A customer checks out, sends Bitcoin, receives confirmation emails thanking and congratulating them for their purchase, views their (nonzero) presale balance on Ethereum.org, and is led to believe that the Ethereum developers intend to hold up their end of the deal. Code written 10 months after the purchase should not be pondering the question "# Accept post-sale purchases?
".
The genesis sale agreement had no provision allowing the foundation/devs to “sell” at a rate of zero ETH. Even if it were ethical, notice would need to be provided to the affected customers (and no such notice was given to me).
Because I trusted the presale balance checker on the Ethereum.org website (which indicated 175.29 ETH), it took nearly two years after the launch of the Ethereum blockchain before I realized that my presale wallet actually had zero ethereum. Getting the silent treatment from the Ethereum Foundation is something that I didn’t expect. Not one reply to me about this, after numerous respectful emails to various Ethereum.org email addresses. Even after a friend of mine got someone from “Communications” to reply last month, and got me on an email thread with them, they would not reply once I provided documentation and asked for my 175.29 ETH. I can see that my accepted Bitcoin was transferred and spent.
There are two presale wallet addresses that were assigned a zero balance for the genesis block. These addresses were reported as having a balance on the Ethereum.org website prior to late 2017. The Ethereum Foundation never once replied to my numerous emails, but their balance checker was afterward updated to show a zero balance instead. Something that at first appeared to be an honest mistake now feels a lot like theft, as I’ve gotten burned several times:
This is not an acceptable way to treat an early supporter. Yes I am aware that the Ethereum.org website claims:
"Are you looking for the official Ethereum support? The first thing you should know is that Ethereum is decentralized. This means no central organization, entity, or person owns Ethereum, and because of this, no official support channels exist."
That’s no excuse. I shouldn’t have had to resort to opening a public Github issue and tagging @vbuterin to attempt to resolve a matter that could have been handled in private. Perhaps the Ethereum Foundation and the devs aren't communicating well. Because at least one of the devs should easily be able to afford 175.29 ETH to honor the genesis sale agreement. They have orders of magnitude more ETH, i.e.:
https://etherscan.io/address/0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae
My genesis address:
https://etherscan.io/address/0x5ed3f1ebe2ae6756b5d8dc19cad02c419aa5778b
My payment (which generated a “congratulations” purchase confirmation email):
https://www.blockchain.com/btc/tx/3d4e17efa6c9e1eac81d950deafc9b4abd905694358bbfd39cedcc82336f1ca5
When checking out on the genesis sale website, users were told to read and agree to contracts and disclosures (which takes time to carefully read). Users weren’t warned that the checkout should be completed by a particular time. On the contrary, after I completed payment and checkout, I was congratulated.
This Python script had no warning output indicating which addresses got the “post_rate” treatment (Bitcoin taken with nothing provided in return). If it did, it would have helped avoid launching the genesis block with the affected addresses, by helping the team identify the inconsistency with the presale balance checker.
Even the other address (of someone I don’t know) was shown to have only around 15 times as much ETH as mine (prior to the update to the balance checker). Assuming they’re (still) owed, even it is a drop in the bucket for the devs to compensate. For some reason communication isn't happening, and I've tried since May 2017. I've only been asking for what I paid for; what the presale wallet checker indicated I should have: 175.29 ETH. I’m owed at least that much - given the hassle, opportunity cost, not having a balance on forks (e.g. Ethereum Classic), feeling ripped off, etc.
Whether I’m paid by @vbuterin, the Ethereum Foundation, EthDev smart contract, someone else involved with the presale, etc - that is a detail that I shouldn’t need to concern myself with. I’m tired of the silent treatment and the waiting - it’s almost 2022. Please don’t make me wait longer - let’s settle for the original amount. Legal action ought to be unnecessary. I still have access to my presale wallet key, so ETH can be transferred to my presale address at your earliest convenience.
After running the python script I don't get an output file of "genesis_block.json" or "genesis.json"
Is this intended? Do I need to make my own file of that output?
Hi,
I'm using cmd to generate the genesis block, but there seems to be something wrong with the script, mk_genesis_block.py
I get the following error:
python mk_genesis_block.py --extradata hash_for_0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa > genesis_block.json
File "mk_genesis_block.py", line 293
print json.dumps(evaluate(), indent=4)
^
SyntaxError : invalid syntax
Can someone help me out please...
Thanks
Hi,
Dunno if anyone's still tracking this file 4 years later, as I'm looking to pull the original mainnet genesis.json file myself. Here's the error I receive after running this on Python2:
sudo python mk_genesis_block.py --extradata
0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa > genesis.json
Gathered history: 9082
API not returning data. Retrying
API not returning data. Retrying
API not returning data. Retrying
API not returning data. Retrying
Traceback (most recent call last):
File "mk_genesis_block.py", line 293, in
print json.dumps(evaluate(), indent=4)
File "mk_genesis_block.py", line 283, in evaluate
th = get_txs_and_heights(outs)
File "mk_genesis_block.py", line 182, in get_txs_and_heights
fetched_txs = fetchtx(txhashes)
File "mk_genesis_block.py", line 153, in new_method
c[str(arg)] = method(arg)
File "/home/user/.local/lib/python2.7/site-packages/bitcoin/bci.py", line 339, in blockr_fetchtx
jsondata = json.loads(make_request(blockr_url+txhash).decode("utf-8"))
File "/home/user/.local/lib/python2.7/site-packages/bitcoin/bci.py", line 23, in make_request
raise Exception(p)
Exception: <urlopen error [Errno -2] Name or service not known>
Bad tx found (genesis output index not zero): 79a554739734b70ed834281d72a00006e576c645b486855b601257abdf3bdb75
when pulling down the genesis block: python mk_genesis_block.py --extradata 0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa
Any suggestion?
Also Do we really have to pull down everything even if we add the --insight flag for privatenet?
CanaryInTheMine found that Python 3.x doesn't work. Someone should either:
This looks close: http://stackoverflow.com/questions/11277721/python-2-code-if-python-3-then-sys-exit
(Or just update blog posts/documentation and tell people to use Python 2.x, this is the easiest!)
python mk_genesis_block.py --extradata hash_for_0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa> genesis_block.json
Traceback (most recent call last):
File "mk_genesis_block.py", line 124, in
EXTRADATA = (d[2:] if d[:2] == '0x' else d).decode('hex')
File "/usr/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
output = binascii.a2b_hex(input)
TypeError: Odd-length string
It generates an empty genesis_block.json.
anytime i run
python make_genesis_block.py --extradata hash_for_1028201
i keep getting
Traceback (most recent call last):
File "make_genesis_block.py", line 124, in
EXTRADATA = (d[2:] if d[:2] == '0x' else d).decode('hex')
File "c:\Python27\lib\encodings\hex_codec.py", line 42, in hex_decode
output = binascii.a2b_hex(input)
TypeError: Non-hexadecimal digit found
I am on ubuntu 14.04 and python 2.7.6 and get the above error when running the script. Here are the replication steps:
Output is then:
cmt@ubuntu:/projects/ethereum$ python mk_genesis_block.py --extradata hash_for_0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa > genesis_block.json/projects/ethereum$
Traceback (most recent call last):
File "mk_genesis_block.py", line 118, in
_get_block_timestamp = b.get_block_timestamp
AttributeError: 'module' object has no attribute 'get_block_timestamp'
cmt@ubuntu:
Could you please double-check my answer to this comment/question?
https://blog.ethereum.org/2015/07/27/final-steps/#comment-2160766270
TLDR: Given that you're downloading things from a hard coded IP over HTTP, does the fact that a hash is passed in protect against all attacks (i.e. malicious data)?
Using the newest version, Ubuntu server 15.04 64bit.
Seems like an API issue, different timestamps and amount of transactions everytime I try running the script.
Output:
http://pastebin.com/jpr0En0g
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.