7

I'm messing around with contracts on my own private network with the command:

geth --dev console

If I want to start from a clean environment (i.e. delete all accounts on the private netowrk), how do I clear the cache?

7

You can specify the directory which contains chaindata and keystore ... Use the --datadir "path/to/mydir" with geth. To clear just remove this directory.

In short:

geth --datadir ~/myprivateblockchain init my_genesis.json
geth --datadir ~/myprivateblockchain account new
geth --dev --datadir ~/myprivateblockchain console

To reset:

rm -rf ~/myprivateblockchain

You could use this python script to create & manage private blockchain: https://github.com/regispietra/CreatePrivateEthereum

Have Fun

  • I realized that I could also delete the default data store of ~/Library/Ethereum but keep the keystore. – timothyylim Jun 19 '16 at 12:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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