> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Using snap sync for node operators

> Learn how to use and enable snap sync on your node.

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

## Enable snap sync for your node

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

  * If you set the port with [`--discovery.port`](/node-operators/reference/op-geth-config#discoveryport), then you must open the port specified for UDP.
  * If you set [`--port`](/node-operators/reference/op-geth-config#port), then you must open the port specified for TCP.
  * The only exception is for sequencers and transaction ingress nodes.
</Info>

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.

### Configuration for op-node

The following flag is not the default setting and must be explicitly configured on `op-node`:

```shell theme={null}
--syncmode=execution-layer
```

### Configuration for op-geth

The following flag is the default setting for `op-geth` to enable snap sync, so you don't need to set it explicitly:

```shell theme={null}
--syncmode=snap
```

### Configuration for Nethermind

<Warning>
  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.
</Warning>

```shell theme={null}
--config op-mainnet
--Sync.SnapSync=true
```

## Enabling execution layer sync for alternative clients

In addition to `op-geth` and `Nethermind`, you can enable execution-layer syncing with alternative execution clients such as `reth` and `op-erigon`.

Unlike `op-geth` and `Nethermind`, `reth` and `op-erigon` are designed as archive nodes, which means they require the complete history of the chain.
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.

For OP Mainnet, the [bedrock datadir](/node-operators/guides/management/snapshots) is required. For other OP Stack networks, no datadir is required.

### Configuration for op-node with reth

Set the following flags on `op-node`:

```shell theme={null}
--syncmode=execution-layer
--l2.enginekind=reth
```

<Info>
  Both flags are not the default setting and must be explicitly configured on `op-node`.
</Info>

### Configuration for op-node with op-erigon

Set the following flags on `op-node`:

```shell theme={null}
--syncmode=execution-layer
--l2.enginekind=erigon
```

<Info>
  Both flags are not the default setting and must be explicitly configured on `op-node`.
</Info>

## Alternative sync modes

Snap sync is the recommended sync mode for most node operators, but other sync modes are available depending on your needs:

* **Archive nodes**: If you need to maintain complete historical state, see the [Archive Node guide](/node-operators/guides/management/archive-node)
* **Consensus-layer sync**: For independent L1-based verification without P2P networking, see the [Consensus-Layer Sync reference](/node-operators/reference/consensus-layer-sync)

## Next steps

* See the [Snap Sync feature page](/node-operators/reference/features/snap-sync) for an overview of how snap sync works and its benefits.
* See the [Consensus Client Configuration](/node-operators/guides/configuration/consensus-clients) and [Execution Client Configuration](/node-operators/guides/configuration/execution-clients) guides for additional explanation or customization.
* To enable snap sync for your chain, see [Using Snap Sync for Chain Operators](/chain-operators/guides/features/snap-sync).
* If you experience difficulty at any stage of this process, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions).
