2

I have currently set up and synced a full node with Geth for the execution layer and Teku for the consensus layer. I need to attach a Blockscout explorer to it and Blockscout requires the node to be an archive node in order to index the transactions. Is there a way to convert my full node into an archive node without having to sync the whole chain again? Or at least download the chain and not have the node verify the blocks fetched?

When I started syncing the full node, it first downloaded a couple of slots and then took two minutes to verify those slots that it downloaded. So, if it's not possible to convert a full node directly into an archive node, is there a way to build an archive node by downloading the blocks and not running the process that takes two minutes to verify the slots that the node has downloaded?

1 Answer 1

3

Dev advocate at Chainstack here!

Your full node prunes data periodically to save space, only retaining data for the last 128 blocks at any given period (about 25 minutes).

From the Geth docs:

Only the most recent 128 block states are stored in a full node - older block states are pruned periodically and represented as a series of checkpoints from which any previous state can be regenerated on request. 128 blocks is about 25.6 minutes of history with a block time of 12 seconds. To create a full node pass --syncmode full at startup.

This means that your node doesn't store all of the states before that point, so if you want to get that data, you will have to re-process the transactions or re-download from an earlier checkpoint. It says you can rebuild the states in between, but keep in mind that this process is very memory intensive and might kill your node!

Geth gives you two options to run an archive node:

  1. Start syncing an archive node from genesis.

    • From the Geth docs:

    Archive nodes are created by configuring Geth’s garbage collection so that old data is never deleted, run: geth --syncmode full --gcmode archive.

  2. Sync an archive node using the snap mode, which syncs the node from a recent snapshot but doesn't prune the data. So, in this case, you can have a partial archive node without access to the data before the snapshot was taken.

    • From the Geth docs:

    It is also possible to create a partial/recent archive node where the node was synced using snap but the state is never pruned. This creates an archive node that saves all state data from the point that the node first syncs. This is configured by starting Geth with: geth --syncmode snap --gcmode archive.

To summarize

It is technically possible to "convert" a full node into an archive node, but you won't have access to the entire chain, only the new data moving forward from when your node was synced. If you want to access the whole chain from genesis, you'll need to sync an archive node from scratch, which is a very intense process. At this time, the Ethereum network is around 12TB in size, and your node would need to download the data and re-process all of the transactions; this process can take months!

If you need the entire chain data soon, I would recommend using a service like Chainstack; you can deploy an archive node in a few seconds :)

Also, take a look at this article about full and archive nodes if you want more insights, and in a few days, we'll also publish a new article diving deep into Geth and Erigon, where you can learn more about the sync modes!

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.