From 1cf49f82985327b023370fee50beab7fb9cf6463 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 ac9e52b66..e41adef85 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -53,3 +53,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 ./reth-data relative to docker-compose.yml if not set. +HOST_DATA_DIR=./reth-data diff --git a/.env.sepolia b/.env.sepolia index e518129fb..a7b7d5b5a 100644 --- a/.env.sepolia +++ b/.env.sepolia @@ -53,3 +53,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 ./reth-data relative to docker-compose.yml if not set. +HOST_DATA_DIR=./reth-data diff --git a/README.md b/README.md index 2e0b62998..7cdcf52d7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,12 @@ Base is a secure, low-cost, developer-friendly Ethereum L2 built on Optimism's [ BASE_NODE_L1_ETH_RPC= BASE_NODE_L1_BEACON= ``` -4. Start the node: +4. Set the data directory (optional but recommended): + ```bash + HOST_DATA_DIR=./reth-data + ``` + This path on the host machine is where chain data will be persisted. If not set, Docker will default to `./reth-data`. +5. Start the node: ```bash # For mainnet (default):