1

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

1
  • 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? Apr 24, 2019 at 16:16

1 Answer 1

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.
1
  • hi, which data directory? I think file is required in import? Aug 25, 2022 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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