8

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.

3 Answers 3

4

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).

1
  • hm... any idea why I get Blockchain not empty, fast sync disabled after a restart? --fast has always been used.
    – Flurin
    Commented Jul 19, 2017 at 17:33
1

Also, when fast syncing finished, i.e. you get in sync with the network and at least one of the full blocks gets updated, fast syncing will no longer be possible (unless starting clean). At least that's how it worked in my experience.

1

I will point out that both answers earlier are somewhat correct:

geth --fast only works if chaindata is empty, the only time geth is in actual fast mode is when you run it with empty chaindata. Newer versions of geths has fast mode by default, but that does not mean you are actually any faster than full mode. this has several implications:

  1. if you are syncing it for the first time, geth --fast works, it downloads a snapshot of history
  2. if your are not syncing for the first time, geth --fast will not result in errors, but you will see a log message saying "blockchain not empty, fast sync disabled". This means although you are running with --fast, because chaindata is not empty, you are actually not fast syncing.

    2.a If fast sync completed before, it is fine, it has done its job and you can continue to be synced

    2.b If fast sync did not complete, there is no way to resume, you must remove chain data and restart fast sync again from scratch

Your Answer

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

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