0

I am running a private ethereum node with a single node. and it creates a folder for the keystore and chaindata But on restart, all the data is gone even the balance as well.

init genesis.json is occurred only once and later only this:

geth --gcmode archive --port 3000 --networkid 15 --nodiscover --datadir=./block-data --maxpeers=2 --rpc --rpcaddr 0.0.0.0 --rpcport 8545 --rpccorsdomain "*" --rpcapi "eth,net,web3,personal,miner" --allow-insecure-unlock

  • I think maxpeers=2 should be maxpeers 0. I think we need a more complete picture of your startup scripts and testing methodology to confirm that there is indeed something unexpected happening and what is causing it. Also, what version of geth? – Rob Hitchens - B9lab Apr 24 at 16:16
0

Well, I got the solution, when you run the network its saves keychain and nodedata on --datadir. To make the data available while restarting the network 2 points are important :

  1. Don't init again which is geth init genesis.json, it will reset.
  2. Use geth import {DIR} , directory used in --datadir.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.