I use the following two lines to initiate and run a private blockchain. Assume I have sent some transactions to it and now for some reasons (e.g. server is malfunctioning) I need to restart the chain. My chain is run on only one node/server (so there is no network and everything is running on one server)

   geth --identity "MyNodeName" --rpc --rpcport "8545" --rpccorsdomain 
   "*" --datadir Users/TestChain1 --port "30303" --rpcaddr ""  
   --nodiscover --rpcapi "db,eth,net,web3,personal" --networkid 123 
   init /Users/CustomGenesis.json

 geth --identity "MyNodeName" --rpc --rpcport "8545" --rpccorsdomain 
 "*"  --datadir Users/TestChain1 --port "30303" --nodiscover --rpcapi 
 "db,eth,net,web3,personal" --networkid 123 console

Question: Can I stop the blockchain and then re-run the blockchain without losing any data stored in it?



Just skip the first command (so no init) and geth will take the chaindata saved at Users/TestChain1 to continue :)

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.