You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to configure and run an archive node.
4
+
---
5
+
6
+
This guide shows you how to configure your node to run as an archive node. Archive nodes store the complete history of the blockchain, including all historical states.
7
+
8
+
## Overview
9
+
10
+
Archive nodes maintain the entire state history of the blockchain, allowing you to query any historical state at any block height. This is useful for:
11
+
12
+
* Block explorers that need to provide historical data
13
+
* Analytics and data analysis applications
14
+
* Services that need to query historical state
15
+
* Debugging and auditing purposes
16
+
17
+
Archive nodes use execution-layer sync but configure the execution client to retain all historical state data instead of pruning it.
18
+
19
+
## Requirements
20
+
21
+
***OP Mainnet**: Requires the [bedrock datadir](/operators/node-operators/management/snapshots)
22
+
***Other OP Stack networks**: No datadir required
23
+
***Storage**: Archive nodes require significantly more disk space than regular nodes (several terabytes for OP Mainnet)
24
+
***Sync time**: Archive sync with execution-layer mode is faster than full block-by-block execution
25
+
26
+
## Configuration
27
+
28
+
### Configuration for op-node
29
+
30
+
Set the following flag on `op-node`:
31
+
32
+
```shell
33
+
--syncmode=execution-layer
34
+
```
35
+
36
+
<Info>
37
+
The `--syncmode=execution-layer` flag is not the default setting and must be explicitly configured.
38
+
</Info>
39
+
40
+
### Configuration for op-geth
41
+
42
+
Set the following flags on `op-geth`:
43
+
44
+
```shell
45
+
--syncmode=full
46
+
--gcmode=archive
47
+
```
48
+
49
+
<Info>
50
+
Both flags are not the default settings and must be explicitly configured. The `--syncmode=full` flag ensures every block is executed, and `--gcmode=archive` disables state pruning.
51
+
</Info>
52
+
53
+
### Configuration for Nethermind
54
+
55
+
Archive sync can be enabled by using the archive configuration for your network (configurations with `_archive` suffix):
56
+
57
+
```shell
58
+
--config op-mainnet_archive
59
+
```
60
+
61
+
<Info>
62
+
Replace `op-mainnet_archive` with the appropriate archive configuration for your network (e.g., `op-sepolia_archive` for OP Sepolia).
63
+
</Info>
64
+
65
+
## Archive mode with alternative clients
66
+
67
+
Alternative execution clients such as `reth` and `op-erigon` are designed as archive nodes by default, which means they always maintain the complete history of the chain. When using these clients with execution-layer sync, they will automatically operate in archive mode.
68
+
69
+
### Configuration for op-node with reth
70
+
71
+
Set the following flags on `op-node`:
72
+
73
+
```shell
74
+
--syncmode=execution-layer
75
+
--l2.enginekind=reth
76
+
```
77
+
78
+
<Info>
79
+
Both flags are not the default setting and must be explicitly configured on `op-node`. `reth` operates as an archive node by default.
80
+
</Info>
81
+
82
+
### Configuration for op-node with op-erigon
83
+
84
+
Set the following flags on `op-node`:
85
+
86
+
```shell
87
+
--syncmode=execution-layer
88
+
--l2.enginekind=erigon
89
+
```
90
+
91
+
<Info>
92
+
Both flags are not the default setting and must be explicitly configured on `op-node`. `op-erigon` operates as an archive node by default.
93
+
</Info>
94
+
95
+
## How archive sync works
96
+
97
+
With execution-layer sync mode enabled:
98
+
99
+
1.**Initial sync**: The node downloads block headers and data through the P2P network
100
+
2.**Block execution**: The node executes every block in the chain to build the complete state history
101
+
3.**State retention**: Unlike regular nodes, archive nodes never prune historical state data
102
+
4.**Faster than legacy**: While still executing all blocks, this is faster than the legacy consensus-layer sync because block data is retrieved via P2P instead of being derived from L1
103
+
104
+
## Storage considerations
105
+
106
+
Archive nodes require substantial storage:
107
+
108
+
***OP Mainnet**: Several terabytes and growing
109
+
***Other networks**: Varies by network age and activity
110
+
***Growth rate**: Storage requirements increase continuously as new blocks are added
111
+
***Recommendation**: Use fast SSD storage for optimal performance
112
+
113
+
## Next steps
114
+
115
+
* See the [Snap Sync guide](/node-operators/guides/management/snap-sync) for non-archive node configuration
116
+
* See the [Node Configuration](/node-operators/guides/base-config#configuration) guide for additional explanation or customization
117
+
* See the [Snapshots guide](/node-operators/guides/management/snapshots) for information about downloading the bedrock datadir
118
+
* If you experience difficulty at any stage of this process, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions)
Copy file name to clipboardExpand all lines: node-operators/guides/management/snap-sync.mdx
+69-99Lines changed: 69 additions & 99 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,125 +3,95 @@ title: Using snap sync for node operators
3
3
description: Learn how to use and enable snap sync on your node.
4
4
---
5
5
6
-
This guide reviews the optional feature of Snap Sync for node operators, including benefits and how to enable the feature.
7
-
8
-
Snap Sync significantly improves the experience of syncing an OP Stack node. Snap Sync is a native feature of the execution clients. Both `op-geth` and `nethermind` support Snap Sync, which can be optionally enabled on `op-node` with `op-geth` or `nethermind`.
9
-
Snap Sync works by downloading a snapshot of the state from other nodes on the network and is then able to start executing blocks from the completed state rather than having to re-execute every single block.
10
-
This means that performing a Snap Sync is significantly faster than performing a full sync.
11
-
12
-
* For OP Mainnet, node operators will be able to sync without having to download the [bedrock datadir](/operators/node-operators/management/snapshots).
13
-
* This also enables nodes to join the network after Ecotone activates without requiring a [blob archiver](/operators/node-operators/management/blobs).
14
-
* Archive nodes are also fully supported.
6
+
This guide shows you how to enable and configure Snap Sync for your node. For an overview of how snap sync works and its benefits, see the [Snap Sync feature page](/node-operators/reference/features/snap-sync).
15
7
16
8
## Enable snap sync for your node
17
9
18
10
<Info>
19
-
For snap sync, all `op-geth` nodes should expose port `30303` TCP and `30303` UDP to easily find other op-geth nodes to sync from.
20
-
* If you set the port with [`--discovery.port`](/node-operators/guides/execution-config#discoveryport), then you must open the port specified for UDP.
11
+
For snap sync, all `op-geth` nodes should expose port `30303` TCP and `30303` UDP to easily find other op-geth nodes to sync from.
12
+
* If you set the port with [`--discovery.port`](/node-operators/guides/execution-config#discoveryport), then you must open the port specified for UDP.
21
13
* If you set [`--port`](/node-operators/guides/execution-config#port), then you must open the port specified for TCP.
22
14
* The only exception is for sequencers and transaction ingress nodes.
23
15
</Info>
24
16
25
-
Choose one of the following options to enable snap sync:
26
-
27
-
***Option 1:** Snap sync, no required datadir on OP Mainnet. This is the recommended option because `op-node` tells `op-geth` to snap sync and then `op-geth` downloads the state at tip and once complete switches to inserting blocks one by one.
A single restart of `Nethermind` during Snap Sync may extend the sync time by up to 2 hours because `Nethermind` has to rebuild the caches by reading millions of values from the database.
50
-
</Info>
51
-
</Tabs.Tab>
52
-
</Tabs>
53
-
54
-
***Option 2:** Archive sync with required [datadir](/operators/node-operators/management/snapshots) for OP Mainnet, but no required datadir for other OP Stack networks.
55
-
This option is faster for archive nodes than other options because `--syncmode=full` means `op-geth` executes every block in the chain.
Snap sync requires no datadir on OP Mainnet. With snap sync, `op-node` tells the execution client to snap sync, and then the execution client downloads the state at tip and once complete switches to inserting blocks one by one.
18
+
19
+
### Configuration for op-node
20
+
21
+
```shell
22
+
--syncmode=execution-layer
23
+
```
24
+
25
+
<Info>
26
+
The `--syncmode=execution-layer` flag is not the default setting and must be explicitly configured.
27
+
</Info>
28
+
29
+
### Configuration for op-geth
30
+
31
+
```shell
32
+
--syncmode=snap
33
+
```
34
+
35
+
<Info>
36
+
The `--syncmode=snap` flag is the default setting for `op-geth`.
37
+
</Info>
38
+
39
+
### Configuration for Nethermind
40
+
41
+
```shell
42
+
--config op-mainnet
43
+
--Sync.SnapSync=true
44
+
```
45
+
46
+
<Warning>
47
+
A single restart of `Nethermind` during Snap Sync may extend the sync time by up to 2 hours because `Nethermind` has to rebuild the caches by reading millions of values from the database.
48
+
</Warning>
103
49
104
50
## Enabling execution layer sync for alternative clients
51
+
105
52
In addition to `op-geth` and `Nethermind`, you can enable execution-layer syncing with alternative execution clients such as `reth` and `op-erigon`.
106
53
107
-
Unlike `op-geth` and `Nethermind`, `reth` and `op-erigon` are designed as archive nodes, which means they require the complete history of the chain.
54
+
Unlike `op-geth` and `Nethermind`, `reth` and `op-erigon` are designed as archive nodes, which means they require the complete history of the chain.
108
55
However, these clients can still retrieve block headers and data through the P2P network instead of deriving each individual block, resulting in a faster initial sync.
109
56
110
-
For OP Mainnet, the [bedrock datadir](/operators/node-operators/management/snapshots) is required. For other OP Stack networks, no datadir is required.
57
+
For OP Mainnet, the [bedrock datadir](/operators/node-operators/management/snapshots) is required. For other OP Stack networks, no datadir is required.
58
+
59
+
### Configuration for op-node with reth
60
+
61
+
Set the following flags on `op-node`:
111
62
112
-
To enable execution layer sync for these clients, set the following flags on `op-node`:
113
63
```shell
114
-
# for reth
115
-
--syncmode=execution-layer (not default)
116
-
--l2.enginekind=reth (not default)
64
+
--syncmode=execution-layer
65
+
--l2.enginekind=reth
66
+
```
67
+
68
+
<Info>
69
+
Both flags are not the default setting and must be explicitly configured on `op-node`.
70
+
</Info>
117
71
118
-
# for erigon
119
-
--syncmode=execution-layer (not default)
120
-
--l2.enginekind=erigon (not default)
72
+
### Configuration for op-node with op-erigon
73
+
74
+
Set the following flags on `op-node`:
75
+
76
+
```shell
77
+
--syncmode=execution-layer
78
+
--l2.enginekind=erigon
121
79
```
122
80
81
+
<Info>
82
+
Both flags are not the default setting and must be explicitly configured on `op-node`.
83
+
</Info>
84
+
85
+
## Alternative sync modes
86
+
87
+
Snap sync is the recommended sync mode for most node operators, but other sync modes are available depending on your needs:
88
+
89
+
***Archive nodes**: If you need to maintain complete historical state, see the [Archive Node guide](/node-operators/guides/management/archive-node)
90
+
***Consensus-layer sync**: For independent L1-based verification without P2P networking, see the [Consensus-Layer Sync reference](/node-operators/reference/consensus-layer-sync)
91
+
123
92
## Next steps
124
93
125
-
* See the [Node Configuration](/node-operators/guides/base-config#configuration) guide for additional explanation or customization.
94
+
* See the [Snap Sync feature page](/node-operators/reference/features/snap-sync) for an overview of how snap sync works and its benefits.
95
+
* See the [Node Configuration](/node-operators/guides/base-config#configuration) guide for additional explanation or customization.
126
96
* To enable snap sync for your chain, see [Using Snap Sync for Chain Operators](/operators/chain-operators/management/snap-sync).
127
97
* If you experience difficulty at any stage of this process, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions).
0 commit comments