Python error when trying to create genesis block

Hey, I'm getting apython error when I'm trying to generate the genesis block:

python ./mk_genesis_block.py --extradata 0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa

....
Collected timestamps: 3020
Collected timestamps: 3040
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 285, in evaluate
p = list_purchases(th)
File "./mk_genesis_block.py", line 224, in list_purchases
t = get_block_timestamp([x['height'] - 1 for x in subpq])
File "./mk_genesis_block.py", line 153, in new_method
c[str(arg)] = method(arg)
File "/Library/Python/2.7/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

Comments

  • fynnfynn Member Posts: 5
    terhechte said:

    Hey, I'm getting apython error when I'm trying to generate the genesis block:

    python ./mk_genesis_block.py --extradata 0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa

    ....
    Collected timestamps: 3020
    Collected timestamps: 3040
    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 285, in evaluate
    p = list_purchases(th)
    File "./mk_genesis_block.py", line 224, in list_purchases
    t = get_block_timestamp([x['height'] - 1 for x in subpq])
    File "./mk_genesis_block.py", line 153, in new_method
    c[str(arg)] = method(arg)
    File "/Library/Python/2.7/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

    Have you tried upgrading bitcoin pip lib:
    (sudo) pip install --upgrade bitcoin
  • terhechteterhechte Member Posts: 5
    Yeah. that didn't help, however adding --insight worked. Thanks!
  • CarlWillhelmCarlWillhelm Member Posts: 20
    im getting exactly the same error but --insight isnt working for me... anybody an idea?


    python mk_genesis_block.py --extradata --insight 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/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
    output = binascii.a2b_hex(input)
    TypeError: Odd-length string
  • fynnfynn Member Posts: 5
    edited July 2015

    im getting exactly the same error but --insight isnt working for me... anybody an idea?


    python mk_genesis_block.py --extradata --insight 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/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
    output = binascii.a2b_hex(input)
    TypeError: Odd-length string

    The hash is an argument for extradata, should be appended after it, like that:

    python mk_genesis_block.py --extradata 0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa --insight > genesis_block.json
  • fuzionrigfuzionrig Member Posts: 4
    edited July 2015
    I am at only block 288
  • CarlWillhelmCarlWillhelm Member Posts: 20
  • HCubedHCubed Member Posts: 5
    Is anyone else having a syntax error with the script? I keep getting the following response:
    File "mk_genesis_block.py", line 293
    print json.dumps(evaluate(), indent=4)
    ^
    SyntaxError: invalid syntax
  • J_GrahnJ_Grahn Member Posts: 1
    @HCubed I think you're using Python 3. print is a function: print(json.dumps(evaluate(), indent=4) There will be other changes needed as well. Install Python 2 and solve all of your problems at once.
  • HCubedHCubed Member Posts: 5
    Thanks J_G... did that after checking a few other threads, and it worked. Forgot to update here...
    B)
  • HeisenTradeHeisenTrade Member Posts: 51
    i do have this problem, even with insight
  • sclopitsclopit Member Posts: 10
    after having updated the python bitcoin module

    sudo pip install --upgrade bitcoin

    I launch

    mk_genesis_block.py --extradata 0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa --insight > genesis_block.json

    and receive the error message

    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 295, in
    print json.dumps(evaluate(), indent=4)
    File "mk_genesis_block.py", line 283, in evaluate
    outs = history(exodus)
    File "mk_genesis_block.py", line 155, in new_method
    c[str(arg)] = method(arg)
    File "mk_genesis_block.py", line 74, in insight_history
    hashes = json.loads(make_request(INSIGHT_ADDR + '/api/addr/'+a))["transactions"]
    File "mk_genesis_block.py", line 69, in make_request
    raise Exception(p)
    Exception:

    I am on a MacBook Pro OSX 10.10.4 and running Python 2.7.6

    please advise

    thanks in advance

  • sclopitsclopit Member Posts: 10
    ok, I managed to generate

    genesis_block.son

    by *omitting* the --insight flag.

    maybe the meaning of that flag (what it does, when it should/should not be used) is super-obvious to the inner circle of Ethereum developers.

    but you have no idea how confusing/frustrating this all is from someone on the outside.
  • StephanTualStephanTual mod London, EnglandMember, Moderator Posts: 1,282 mod
    @sclopit "By default, the script uses Blockr and Blockchain.info to fetch the Genesis pre-sale results. You can also add the --insight switch if you’d instead prefer to use the private Ethereum server to obtain this information. If you are facing issues with the script, please raise an issue on its github."

    Source: https://blog.ethereum.org/2015/07/27/final-steps/
Sign In or Register to comment.