2

I am currently running the latest Geth 1.8.1 Iceburg version. I setup a private Ethereum network following a tutorial and everything including mining works fine, but every time I restart Geth, the chain resets back to block number 0 all the mining transactions have gone missing and no ETH balance as well but transactions are recorded in the logs.

commands used:

geth --datadir "$ethereum_home/EthMasterChain" console 2>console.log

geth --datadir "$ethereum_home/EthMasterChain" init "$ethereum_home/genesis.json"

json file used:

{
    "config": {
    "chainId": 1234,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "nonce": "0x0000000000000045",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "gasLimit": "0x8900000",
    "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0xbe8d5fce9f60ab06b527dd177eed96eb95ee4138",
    "alloc": {
        "0xbe8d5fce9f60ab06b527dd177eed96eb95ee4138" : {"balance" : "10000000000000000000"}
    }

}
  • Edit your post to include your scripts. – Adam Kipnis Feb 16 '18 at 15:51
  • I assume (hope) you aren't running `init` each time, right? As the name implies, `init` initializes the blockchain (creates block 0). If you run it multiple times, it will overwrite your previous blockchain (unless you specify a different datadir). – Adam Kipnis Feb 16 '18 at 17:03
  • No I am not running init command multiple timess just once – Saliya Perera Feb 17 '18 at 00:26
  • You need to include `--networkid 1234` when you start `geth console`. Otherwise, you'll be connecting to mainnet. However, I'm not sure if that's the cause of your blockchain resetting. Give that a try and see if it helps. – Adam Kipnis Feb 17 '18 at 00:54
  • 2
    Thanks everyone just figured out the issue. Problem is with the geth 1.8 Iceberg version it resets the blockchain everytime u close the console I downgraded to 1.7.3 stable and the issue is solved :) Do not use the 1.8 geth version yet – Saliya Perera Feb 17 '18 at 02:01

0 Answers0