How to delete or reset the blockchain in geth? (OSX)

  • I have a currupt Blockchain and want to hard reset the chain. what do I need to delete in order to start downloading the chain from scratch?

    I know that there are 2 ethereum folders (I am on OSX):

    $home/.ethereum
    $home/Libary/Ethereum
    

    I updated geth recently to "Homestead" 1.3.5 and get error in the terminal like:

    E0306 ... 3211 trie.go:309] Dangling hash node ref 3c6233326.... leveldb: not found
    

    and sometimes I get a bad block warning:

    Bad block #1102797
    

    I updated geth to v 1.3.5, but I also installed eth a while ago (v 1.1.0 / eth newtwork protocol version: 61). I didn't use both a lot just fired them up once in a while

  • For geth, delete $home/Libary/Ethereum/chaindata. That should wipe out the blockchain itself and let you sync from scratch. Also you probably want to do a fast sync afterwards to get back fast-ish on the chain --fast.

    would you start `geth` to reload the chain or direct with `geth --fast`?

    `geth --fast --cache=512 console` is how I would personally start geth :D

    Isn't it more careful to use "geth removedb" instead? It's its purpose.

    For Mac OSX `rm -R ~/Library/Ethereum/geth/chaindata/`

License under CC-BY-SA with attribution


Content dated before 7/24/2021 11:53 AM