12

I had the Mist client installed, but it hadn't been updated in a few weeks so I tried renaming the chaindata folder (instead of deleting it) and downloading the blockchain with geth --fast as that is supposedly faster. I started the download about three days ago, on a capped internet connection that is very slow, and now I still only have 188 MB of data in the chaindata folder. Is there another, faster way to download the blockchain? Should I just restore the Mist chaindata folder and try syncing via the Mist Client, since I already had a large part of the blockchain?

3

6 Answers 6

9

This is a community wiki, with the hope that it can be updated by the community as developments take place.

Here's latest from Ethereum Core developer Péter:

karalabe [Ethereum] - Péter Szilágyi

Hi, the stable geth didn't account for a lot of weak peers, which make syncing quite hard even for well connected peers. One suggestion is to try the latest develop version, which is light years ahead sync wise from the stable branch (https://gitter.im/ethereum/go-ethereum?at=57526dc7e8163f872c4de23c), or if you don't mind building geth for yourself, run this aggregating PR (https://github.com/ethereum/go-ethereum/pull/2657) that introduces a ton of fixes for full imports and higher latency connections. This latter PR should be merged in on Monday and hopefully also pushed out to the stable branch, so you can consider it safe to use :)

You should be able to update to this when the next release, Geth 1.4.6 is available imminently according to Péter. (Geth 1.5 will be released later.)


--cache=1024 should usually be specified in addition to --fast, otherwise the default uses a much smaller cache (--cache=16). A 50% speed increase is possible just by increasing the cache.

If you stop geth --fast, you can run geth --cache=1024 without needing to delete anything.

The flags --jitvm and --jitcache may also give a speed increase.

7
  • You can also try to use the --jitvm and --jitcache to speed things up May 25, 2016 at 21:49
  • Can I change the cache size when a part of the blockchain has already been downloaded with geth --fast? Or do I need to delete the chaindata folder first? I'll have a better internet connection later today and I'll try it out then.
    – dhuyvetter
    May 29, 2016 at 7:29
  • 1
    If you stop geth --fast, you can run geth --cache=1024 without needing to delete anything.
    – eth
    May 29, 2016 at 7:46
  • 1
    The default cache is 128MB on the 1.4 branch :) But yet, perhaps waiting for 1.4.6 is best, given that I'm pushing it out any minute now ;) Jun 6, 2016 at 14:26
  • 1
    @PéterSzilágyi if you don't mind, feel free to edit, simplify or totally rewrite this wiki when you've got time. It could be as simple as "Run Geth 1.4.6 with these switches..." Would be good to include any comments that are useful, since I'll try to clean up some of these comments. Thanks
    – eth
    Jun 6, 2016 at 18:32
5

As said in How much faster is it to sync with --jitvm?, cache and jitvm doesn't change the performance probably due to my ssd.

If you want synch very fast, use the 1.4.6 (not the 1.4.5 or older) version or the 1.5. With the 1.5 version or the 1.4.6, i could synch in 22min with the --fast flag. The 1.4.5 version was > 1h. During, the synch i use a bandwith up to 4MB/s.

https://bintray.com/karalabe/ethereum/geth-develop/1.5.0-unstable-828e1e3/view

Before use of --fast, please remove your db (use geth removedb or remove the chaindata directory)

2
  • I have tried the --cache=1024 and --jitvm options, but have been downloading for days and still haven't gotten the full blockchain. My laptop also has SSD, so --jitvm only improves performacne on regular HDDs? When I get back home I will try with geth 1.5. I did remove the the chaindata folder before using the --fast option.
    – dhuyvetter
    Jun 6, 2016 at 9:14
  • the 1.4.6 is out. This release has the last patch and should probably synch faster. The jitvm will be interesting in the future when we are using very complex smart contract.
    – Ellis
    Jun 7, 2016 at 9:34
4

If you have another machine which you trust and which already has the blockchain downloaded, you can export the db from there and import in your current machine as explained here. In that way the download does not go via network and should be very fast. Note that you have to trust that machine otherwise you might be living on some other blockchain.

1
  • Unfortunately I don't have another machine with a full blockchain. I tried downloading via Mist and via geth on my work machine, but it looks like the network blocks that traffic, as I get no blocks at all.
    – dhuyvetter
    May 25, 2016 at 12:07
2

--fast is very fast but if the db isn't empty it doesn't work. You should empty the db and try it again.

1

For me this was the "best" solution for the last 50.000:

geth --cache=512 --ipcdisable --vmodule=downloader=6
2
  • Could you elaborate? How does disabling the RPC interface and increasing logging verbosity speed up the block synchronization?
    – mxk
    Jun 15, 2016 at 7:50
  • Removed sudo. Don't run geth as root.
    – q9f
    Dec 3, 2016 at 11:08
1

Sure, with parity --warp it takes around 5 minutes to get a snapshot of the last 30,000 blocks and afterwards it will synchronize the blockchain in another 2-3 hours.

However, you will be able to use the node after only a few minutes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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