Speeding up Ethereum-Wallet initial sync on MacOS X

After experimenting with the Ethereum Wallet client on a linux machine I decided to install on my MacPro with OS X 10.11.5.  I installed the latest Ethereum-Wallet 0.8.1 app from github and launched the app.  I soon noticed that the sync would appear to freeze at various points and never achieved a full sync. This despite multiple force quits and restarts.

Ethereum_Wallet
Close, but never closer!

After some poking around I found a nice summary of the problem and a workaround I wanted to share.

StackEchange is my goto source when I have any computer problem and it paid off again today.   Under the topic “Help with slow mist sync” I found several good answers and things to try.  Caveat: what I’m about the describe worked for me, but I am hardly a knowledgable expert and this may be wrong from a technical perspective.

It turns out that, using the command line interface Ethereum client called geth, you can initiate a fast sync by setting certain flags when the program is run.  Details are here.  This will only work, however, if it’s the first attempt at a sync.  I had made dozens of attempts, so I needed to delete all these files.  The first thing I tried worked:

  • I went to my user Library folder (Finder–>Go–>Go To Folder, then type “~/Library” and select ‘Go’).
  • Once there, locate the Ethereum folder and open it.
  • Delete the folder called ‘chaindata’.  (Don’t worry. This folder will be recreated when you do the faster sync.)

To be able to initiate a fast sync using the command line interface tool, we need to know where the geth program is located.  What follows is the description for how to do this by user tayvano at the Ethereum StackExchange:

  • Right click on the ethereum-wallet.app and select ‘show package contents’
  • Open ‘contents’, then ‘frameworks’, then ‘node’, then ‘geth’
  • Then you should right click on geth and select ‘show info’.
  • Copy the location marked ‘Where:’.
  • Open Terminal and type ‘cd‘,  space,  then paste the path you copied in the above step and hit return.

You are now in the geth directory and can run geth, the command line program, with any flags here.  The two flags I added were:

  • --fast  (“enables fast syncing through state downloads rather than downloading the full block data”)
  • --cache=2048 (“Megabytes of memory allocated to internal caching”)  I used 2 GB here.

So the command line instruction was “geth --fast --cache=2048

I accidentally closed the terminal window in which I did the sync without noting the times, but believe it was well under an hour.  I then launched the GUI Ethereum-Wallet application with an up-to-date blockchain.

Ethereum_Wallet
Success!
Tags

Recommended Reading