From e513ecdba9d21bfef684c70c12040670f0b3cfc9 Mon Sep 17 00:00:00 2001 From: mehmetkr-31 Date: Sun, 10 May 2026 20:08:11 +0300 Subject: [PATCH] docs: document HOST_DATA_DIR and add default to env files HOST_DATA_DIR is referenced in docker-compose.yml but is not mentioned in the README and has no default in the bundled .env files. This causes two problems: 1. New operators may not realize they need to set it, leading to chain data being written to an anonymous Docker volume that is hard to locate. 2. If the variable is unset, Docker Compose may mount an empty path. Add HOST_DATA_DIR=./data to both .env.mainnet and .env.sepolia, and add a dedicated step in the Quick Start guide explaining its purpose. --- .env.mainnet | 6 ++++++ .env.sepolia | 6 ++++++ README.md | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.env.mainnet b/.env.mainnet index c5bd040b5..a679f8c11 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -120,3 +120,9 @@ STATSD_ADDRESS="172.17.0.1" # NOTE: The node type that was chosen when first running a node cannot be changed after the initial sync. Turning Archive into Pruned, or Pruned into Full is not supported [source](https://reth.rs/run/faq/pruning/). # NOTE: The pruned snapshots provided are set with a distance of 1_339_200 (~31 days). # RETH_PRUNING_ARGS="--prune.senderrecovery.distance=50000 --prune.transactionlookup.distance=50000 --prune.receipts.distance=50000 --prune.accounthistory.distance=50000 --prune.storagehistory.distance=50000 --prune.bodies.distance=50000" + +# DATA DIRECTORY +# ----------------- +# Path on the host machine where chain data will be persisted. +# Defaults to ./data relative to docker-compose.yml if not set. +HOST_DATA_DIR=./data diff --git a/.env.sepolia b/.env.sepolia index cb9a8b545..46bd499d0 100644 --- a/.env.sepolia +++ b/.env.sepolia @@ -120,3 +120,9 @@ STATSD_ADDRESS="172.17.0.1" # NOTE: The node type that was chosen when first running a node cannot be changed after the initial sync. Turning Archive into Pruned, or Pruned into Full is not supported [source](https://reth.rs/run/faq/pruning/). # NOTE: The pruned snapshots provided are set with a distance of 1_339_200 (~31 days). # RETH_PRUNING_ARGS="--prune.senderrecovery.distance=50000 --prune.transactionlookup.distance=50000 --prune.receipts.distance=50000 --prune.accounthistory.distance=50000 --prune.storagehistory.distance=50000 --prune.bodies.distance=50000" + +# DATA DIRECTORY +# ----------------- +# Path on the host machine where chain data will be persisted. +# Defaults to ./data relative to docker-compose.yml if not set. +HOST_DATA_DIR=./data diff --git a/README.md b/README.md index 1cbaad17d..811520371 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,12 @@ Base is a secure, low-cost, developer-friendly Ethereum L2 built on Optimism's [ OP_NODE_L1_BEACON= OP_NODE_L1_BEACON_ARCHIVER= ``` -4. Start the node: +4. Set the data directory (optional but recommended): + ```bash + HOST_DATA_DIR=./data + ``` + This path on the host machine is where chain data will be persisted. If not set, Docker may use an anonymous volume. +5. Start the node: ```bash # For mainnet (default):