I'm failing on import a testnet blockchain binary file (Bad block #1)

System information

Geth version: 1.4.7
OS & Version: Windows 7

Expected behaviour

Import testnet blockchain from a binary file to the testnet database

Actual behaviour

Geth preloads the default genesis block. The process ends in the block # 1.

Steps to reproduce the behaviour

My first try was:

geth --testnet import ~testnetblockchain.bin

And geth gave me back:

I0811 23:59:37.301085 ethdb/database.go:82] Alloted 128MB cache and 1024 file handles to C:\Users\MultiEBD\AppData\Roaming\Ethereum\testnet\chaindata
I0811 23:59:37.742111 core/headerchain.go:94] WARNING: Wrote default ethereum genesis block
I0811 23:59:37.742111 core/blockchain.go:206] Last header: #0 [d4e56740.] TD=17179869184
I0811 23:59:37.742111 core/blockchain.go:207] Last block: #0 [d4e56740.] TD=17179869184
I0811 23:59:37.742111 core/blockchain.go:208] Fast block: #0 [d4e56740.] TD=17179869184
I0811 23:59:37.742111 cmd/utils/cmd.go:123] Importing blockchain H:\RESPALDOS\CRYPTO\Ethereum\test11082016.bin
E0811 23:59:38.888176 core/blockchain.go:1128] Bad block #1 (0xad47413137a753b2061ad9b484bf7b0fc061f654b951b562218e9f66505be6ce)
E0811 23:59:38.888176 core/blockchain.go:1129] Block's parent unknown 0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303
I0811 23:59:38.888176 ethdb/database.go:169] closed db:C:\Users\MultiEBD\AppData\Roaming\Ethereum\testnet\chaindata
Fatal: Import error: invalid block 2500: Block's parent unknown 0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303
Fatal: Import error: invalid block 2500: Block's parent unknown 0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303


Now, 0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303 is the right hash of the MORDEN genesis block. So I thought that I just needed the genesis.json

My second try was:

geth --testnet init genesis.json

And geth gave me: successfully wrote genesis block and/or chain rule set: c31c07282c5f803da583b8b65f3aa0b5cce411f3ffa6ae11c5e0adb3e057ef4a

then I try again:

geth --testnet import ~testnetblockchain.bin

And geth gave me back:

I0811 23:29:00.224011 ethdb/database.go:82] Alloted 128MB cache and 1024 file handles to C:\Users\MultiEBD\AppData\Roaming\Ethereum\testnet\chaindata
I0811 23:29:00.605032 core/blockchain.go:206] Last header: #0 [c31c0728.] TD=131072
I0811 23:29:00.605032 core/blockchain.go:207] Last block: #0 [c31c0728.] TD=131072
I0811 23:29:00.605032 core/blockchain.go:208] Fast block: #0 [c31c0728.] TD=131072
I0811 23:29:00.605032 cmd/utils/cmd.go:123] Importing blockchain H:\RESPALDOS\CRYPTO\Ethereum\test11082016.bin
E0811 23:29:01.764099 core/blockchain.go:1128] Bad block #1 (0xad47413137a753b2061ad9b484bf7b0fc061f654b951b562218e9f66505be6ce)
E0811 23:29:01.796101 core/blockchain.go:1129] Block's parent unknown 0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303
I0811 23:29:01.845103 ethdb/database.go:169] closed db:C:\Users\MultiEBD\AppData\Roaming\Ethereum\testnet\chaindata
Fatal: Import error: invalid block 2500: Block's parent unknown 0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303
Fatal: Import error: invalid block 2500: Block's parent unknown 0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303


And I don't know what I'm doing wrong.
May be I need the right MORDEN genesis.json file yet.
Or may be that I need to use some geth command to tell it not to write the default genesis block in the chaindata, but import it from the testnetblockchain file I have.

Any suggestion?

Thanks =)
Sign In or Register to comment.