[Ethereum] safely interrupt and restart fast sync in geth

fast-syncgo-ethereumsynchronization

I am new to Ethereum and trying to get set up a new node with geth (using 1.6.5-stable).

I am running geth --fast --cache=1024 and so far have been syncing for around 3 days (Win 7, 6GB RAM). I see lots warnings in the log and a few errors, but the process always seems to continue.

However, when things seem to be moving slowly I have periodically stopped syncing with Ctrl+C. This seems to lead to a clean shutdown of geth. I then restarted again with geth --fast --cache=1024 and syncing appears to pick up again from the same point. Status so far via eth.syncing in the javascript console:

{
  currentBlock: 3294258,
  highestBlock: 3899534,
  knownStates: 47242,
  pulledStates: 3041,
  startingBlock: 3293182
}

Is this OK? Specifically my questions are:

  1. Will it work? Will syncing finish correctly giving a usable node if I continue to follow this practice?
  2. Is it safe to restart with the --fast flag after interrupting? I have read elsewhere that the flag should not be used with a partial download of the blockchain, but I'm not sure whether this refers to a historical "full sync" or any type of partial sync.

Best Answer

Yes, you can restart a syncing the chain with the --fast flag as many times as you like but you have to ensure that it is used every single time. When you synced only for a few seconds without the fast flag, you cannot restart it in fast mode (well you can but it will get auto-switched off).

Related Topic