|
| 1 | +--- |
| 2 | +title: Archive, Full or Expired node |
| 3 | +sidebar_position: 2 |
| 4 | +sidebar_label: History and Pruning |
| 5 | +--- |
| 6 | + |
| 7 | +## Types of nodes |
| 8 | + |
| 9 | +You can run an Archive node, with all history and full lookup for all historical transactions. This may take large amounts of space, depending on the execution layer client. |
| 10 | + |
| 11 | +You can run a Full node, with all history and limited lookup for historical transactions. This fits into a 4TB drive and is often the choice for RPC nodes. |
| 12 | + |
| 13 | +You can run an Expired node, with pre-merge history and receipts gone. This fits into a 2TB drive and is foten the choice for validator nodes. |
| 14 | + |
| 15 | +This is controlled by variables in `.env`, which can be set with `nano .env`. Switching from one type to another often requires a full resync. |
| 16 | + |
| 17 | +`CL_ARCHIVE_NODE` - run the consensus layer node as an archive, including blobs where supported |
| 18 | +`CL_MINIMAL_NODE` - run the consensus layer node with minimal storage |
| 19 | + |
| 20 | +`EL_ARCHIVE_NODE` - run the execution layer node as an archive. The required space can vary widely depending on the client: From right around 2 TB to well over 50TB |
| 21 | +`EL_MINIMAL_NODE` - run the execution layer node with history expiry. `true` is pre-merge history expiry; `rolling` is 1-year rolling if the client supports it; |
| 22 | +`aggressive` expires all but the last few blocks, if the client supoorts it |
| 23 | + |
| 24 | +## Switch from Full to Expired node |
| 25 | + |
| 26 | +You can use `./ethd prune-history` to switch the client to history expiry, in some cases without resync. Note that Besu requires 200 GiB free for this, and |
| 27 | +it will take less space if instead it is resynced with `./ethd resync-execution` while `EL_MINIMAL_NODE=true` |
| 28 | + |
| 29 | +## State pruning |
| 30 | + |
| 31 | +In addition to history, execution layer clients also carry state. Historically, the size of the state DB has been growing and can be pruned periodically. |
| 32 | +Today, only Nethermind still requires a state prune. Note this is entirely separate from history expiry. It applies to Full and Expired nodes. Archive |
| 33 | +nodes should never have their state pruned. |
| 34 | + |
| 35 | +### Automatic Nethermind prune |
| 36 | + |
| 37 | +By default, Nethermind will prune when free disk space falls below 350 GiB on mainnet, or 50 GiB on testnet. If you |
| 38 | +want to disable that, `nano .env` and change `AUTOPRUNE_NM` to `false`. |
| 39 | + |
| 40 | +If you have disabled automatic prune, you can run `./ethd prune-nethermind`. It will check prerequisites, online prune Nethermind, and restart it. |
| 41 | + |
| 42 | +### Continuous Besu prune |
| 43 | + |
| 44 | +Besu continuously prunes with BONSAI, and from 24.1.0 on also prunes its trie-logs. A long-running Besu may benefit |
| 45 | +from a manual trie-log prune, once. |
| 46 | + |
| 47 | +If you have a large amount of trie logs, run `./ethd prune-besu` on a long-running Besu. It will check prerequisites, offline prune Besu trie-logs, and |
| 48 | +restart it. |
| 49 | + |
| 50 | +### Continuous Geth prune |
| 51 | + |
| 52 | +Geth continuously prunes if synced with PBSS. If you are using an old hash-synced Geth, run `./ethd resync-execution` |
| 53 | +to use PBSS. This will cause downtime while Geth syncs, which can take 6-12 hours. |
0 commit comments