0

I am running private ethereum blockchain using ethereum and now I want to reset the chain and delete all the contracts, transactions and logs and restart everything from block 0.

What is the best way to do that?

0

Run the private ethereum chain in a docker container... and then you can throw the container or its data and deploy it again in a matter of seconds those are some examples of how to run a private chain with a docker

https://www.freecodecamp.org/news/how-to-run-geth-from-a-docker-container-b6d30620ca74/

https://medium.com/@javahippie/building-a-local-ethereum-network-with-docker-and-geth-5b9326b85f37

https://medium.com/51nodes/build-a-minimal-quorum-network-90c59ec22226

| improve this answer | |
  • Thanks for your reply! I will install my new chain in docker container but how can I remove my existing chain? – Ruchita Jun 29 at 10:09
  • @Ruchita what is the command you used to start geth? usually in the command, you write the Path (datadir) of where your blockchain data should be saved. like this: geth --datadir="/tmp/eth/60/01" -verbosity 6 --ipcdisable --port 30301 – Majd TL Jun 29 at 10:51
  • geth --datadir ~/chaindata/ --networkid 12345 --verbosity 3 --rpc --port 30304 --rpcport 8545 --rpcaddr "<private IP>" --rpccorsdomain "http://<private IP>:8080, http://<private IP>:8000" --rpcapi "web3,eth,personal,net" --preload "/home/ubuntu/scripts/mineWhenNeeded.js" --nodiscover --gcmode archive --allow-insecure-unlock > ~/myLogs/bcLogs.out 2>&1 & – Ruchita Jun 29 at 12:35
  • if you look for the folder "ChainData" then you will find 2 folders inside it, if you delete them then everything will be removed and you will start again from block 0. that is what I remember from last time using geth local 2 years ago :) @Ruchita – Majd TL Jun 29 at 12:41
  • Thank you so much! – Ruchita Jun 29 at 13:02

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.