I'm running a geth node on slow hardware. At the current rate of progress it could be several days before I can download all the blockchain. Is there a way to get it to synchronise more quickly?

EDIT: Latest Geth now defaults to cache=1024, so if you have more RAM you can try increase the cache.

Don't forget --cache

Everyone mentions --fast but you probably also need --cache=1024. Without it, you are running with the default which is --cache=128 (Geth 1.6.7).

A 50% speed increase is possible just by increasing the cache.

If you are starting from the beginning, use: geth --fast --cache=1024

If you already have some of the blockchain, use: geth --cache=1024

Depending on your RAM, you can also try with higher values, like --cache=2048.

Source

If you are using the geth client, there are some things you can do to speed up the time it takes to download the Ethereum blockchain. If you choose to use the --fast flag to perform an Ethereum fast sync, you will not retain past transaction data.

Note

You cannot use this flag after performing all or part of a normal sync operation, meaning you should not have any portion of the Ethereum blockchain downloaded before using this command. See this Ethereum Stack.Exchange answer for more information.

Below are some flags to use when you want to sync your client more quickly.

--fast

This flag enables fast syncing through state downloads rather than downloading the full block data. This will also reduce the size of your blockchain dramatically. NOTE: --fast can only be run if you are syncing your blockchain from scratch and only the first time you download the blockchain for security reasons. See this Reddit post for more information.

--cache=1024

Megabytes of memory allocated to internal caching (min 16MB / database forced). Default is 16MB, so increasing this to 256, 512, 1024 (1GB), or 2048 (2GB) depending on how much RAM your computer has should make a difference.

  • Is there any update on how long the command geth --fast --cache=1024 should take and how much space it should take up for Sept '17? Its been running for about 18 hours on my mac and has already taken up 20GB – georgej Sep 3 '17 at 19:36
  • In geth 1.6.7 the default cache size is 128MB – k26dr Sep 12 '17 at 19:59
  • @k26dr Thanks, updated the answer with that information. – eth Sep 20 '17 at 9:27
  • Thank you very much for this. I'll be setting up a ETH node on an RPi 3b this week. My internet is 35mbps but that doesn't mean I'll get the blockchain data that fast, right? – Bulrush Nov 22 '17 at 11:16
  • 2
    from latest geth documentation: --cache value Megabytes of memory allocated to internal caching (default: 1024) – blockwala Jul 4 at 9:24

The --fast command line option will sync more quickly. You have to use it from scratch though, you can't use it if the blockchain has been downloaded already. If you have a node which is already synced then you can use the Javascript interface and the exportChain and importChain commands to sync your node.

  • 6
    For --fast it needs to be done before anything has been synced. – eth Feb 15 '16 at 9:44
  • 4
    geth removedb can be used to nuke the database. It shouldn't affect the keystore, but make a backup of the data directory first anyway – Dan Sandberg Mar 5 '16 at 2:43
  • In my case, -fast appears to have no consequences and geth complains: I0508 13:29:49.476026 30960 handler.go:92] blockchain not empty, fast sync disabled – bortzmeyer May 8 '16 at 11:32
  • Have you done geth removedb to empty the database? – paulmorriss May 9 '16 at 16:00
  • Is there an official torrent or similar with an updated chain to import speedily? – Vesa May 29 '16 at 9:25

There are 2 ways using geth, that i am aware of

1. sync with the --fast you can start with geth --fast which Enables fast syncing through state downloads

2. use import command in geth to do this, you need an already synced blockchain from geth and it has to be exported with geth export filename, which can be imported to geth import filename

To synchronize geth the fastest way, i recommand to use geth 1.4.6. Older versions are way slower.

Spoiler: HDD synch is very slow.

There are two modes for synchronization:

  • geth --fast --cache 1024 --jitvm: this method is very fast on powerful computer (25min on my system i7 quad core 16Go, SSD and Gbit/s bandwidth). It uses 4.5GB on disk
  • geth --cache 1024 --jitvm: this method is slower (3h on my system i7 quad core 16Go, SSD and Gbit/s bandwidth). It uses 21GB on disk

Tip 1: If you have already a geth synchronized on a computer, you could backup the chaindata directory and copy it for another computer. I check on OS X, Linux and Windows (all in 64bits version).

Tip 2: The export/import method works. The import duration is very long because it checks all transactions.

Tip 3: If you have enough RAM and no SSD, use your RAM as ramdisk and select your ramdisk with the --datadir option. You need 4.2GB for a fast synch. When the synch is completed, copy the directory chaindata on its original place:

  • ~/.ethereum on linux
  • ~/Library/Ethereum on os x
  • %APPDATA%\Ethereum on Windows

I have made many benchmarks on different versions for this question: How much faster is it to sync with --jitvm?

Note 1: if you use a HDD, it seems that the synchronization is slower. The fast method was 4h on my system.

Note 2: RAMDiskCreator on OS X is a freeware to create a RAM Disk.

jitvm and cache options have a minor impact on my bench

  • in Geth 1.7.3, --fast is deprecated and --jitvm is removed. Do we need alternative flags? – Raptor Jan 19 at 9:17

3. sync on a fast machine and copy chaindata directory to your slow machine The chaindata is portable across architectures. So, sync, stop the node cleanly, transfer the chaindata directory (replacing your old one), and start the node on another machine. To minimize risk, use identical versions of geth on both machines. (I did this for x86_64 -> armv7h successfully with Geth 1.4.5, others did too.)

protected by Afri May 15 '17 at 9:07

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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