I have a private network for testing. My problem is when ever I stop running geth network, all of my mined blocks are gone. I run like
geth --datadir "ethereum/node1" --port 30301 --networkid 1234 --rpc --rpcport "8545" --rpcapi db,eth,net,web3,personal --ws --wsport "8546" --rpccorsdomain "*"
(sometimes I use nohup) and I stop the server using cntrl+c. When geth is running I check block number using eth.blockNumber
and it will show block number and it will increment. After I stop and start my server then I check using eth.blockNumber it always shows 0 and it takes some hour to mine blocks. Due to this, I'm lossing many of test data. Is this a common problem? Is there any work around to prevent this? Any idea will be helpful. Thank you.
-verbosity 5
to geth command line. If geth finishes cleanly it should restart where it left. From your description it appears geth has some problem closing that might leave the database with invalid data that forces a restart from block 0. – Ismael Jul 3 '18 at 17:26