4

There is a geth program running, and provide --rpc service.

What the service do:

  • Sync blocks.
  • Accept rpc requests to create transaction.
  • There is another program try to read the new blocks, and find out the transactions relevant to addresses in our wallets, and sync the data into local database (e.g mysql).

Currently we are using full mode, but it's a bit slow, and takes more disk space.


Questions

  • Is fast mode enough for above usage?
  • Which is better?
  • If we switch from full mdoe to fast mode, will geth have to re-download all the years of historys? Or, it will reuse the history?

(I asked another question about ethereum on Ethereum site, if you are interested could you also take a look: https://ethereum.stackexchange.com/questions/78293/how-to-migrate-geths-data)

Eric
  • 22,183
  • 20
  • 145
  • 196
  • 1
    Stack Overflow is a site for programming and development questions. You should probably use another site on the [Stack Exchange network](https://stackexchange.com/sites) for this question. Also see [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. – jww Dec 15 '19 at 03:05

1 Answers1

11

full sync downloads all blocks of the blockchain and replays all transactions that ever happened. While doing so, it stores the receipts of transactions and continuously updates the state database.

fast sync does not replay transactions. This quote from the fast sync pull request describes it well (You can also find additional information there).

Instead of processing the entire block-chain one link at a time, and replay all transactions that ever happened in history, fast syncing downloads the transaction receipts along the blocks, and pulls an entire recent state database.

Note that it also downloads receipts so historical data can be queried.


  • Is fast mode enough for above usage?

    fast sync is used only for initially getting the blockchain. After the fast sync process ended, your node acts just as a full synced node. Since a fast synced node also has all the historical data, it is suitable for your use-case.

  • Which is better?

    Depends on. In case of full sync, you need processing power, while in the other case, you need bandwidth.

  • If we switch from full mode to fast mode, will geth have to re-download all the years of history? Or, it will reuse the history?

    For security reasons, you can not switch the sync mode of an already running node.

aliras
  • 399
  • 2
  • 6