### Install and Install pre-commit Hooks Source: https://github.com/ethstaker/eth-docker/blob/main/CONTRIBUTING.md Install pre-commit for linting and set up the hooks locally. This ensures code quality before committing. ```bash apt install pre-commit && pre-commit install ``` -------------------------------- ### Install Eth Docker Prerequisites Source: https://github.com/ethstaker/eth-docker/blob/main/README.md Clone the repository, install prerequisites, and configure Eth Docker. Ensure you are not running as root. ```bash cd ~ && git clone https://github.com/ethstaker/eth-docker.git && cd eth-docker ./ethd install ./ethd config ``` -------------------------------- ### Configure Ethereum Node with Interactive Wizard Source: https://context7.com/ethstaker/eth-docker/llms.txt Launches a TUI wizard to configure network, deployment type, clients, MEV-Boost relays, checkpoint sync URL, fee recipient, and Grafana. Writes choices to .env and pulls/builds Docker images. Ensure you have the necessary network and client selections in mind before starting. ```bash ./ethd config # Step 1: Select Network # hoodi / ephemery / mainnet / gnosis / sepolia / custom URL # Step 2: Select deployment type # node (CL+EL+VC) / rpc (CL+EL) / ssv / lido_comp / validator / rocket # Step 3: Select consensus client (e.g. Lighthouse) # Step 4: Select execution client (e.g. Reth) # Step 5: History expiry? (pre-merge / full) # Step 6: MEV Boost? -> relay selection checklist # Step 7: Grafana dashboards? (yes/no) # Step 8: Enter FEE_RECIPIENT ETH address (0x...) # Step 9: Enter graffiti (up to 32 chars) # # Resulting .env excerpt: # CORE_FILES= lighthouse.yml:reth.yml:mev-boost.yml:grafana.yml:grafana-shared.yml # NETWORK=mainnet # FEE_RECIPIENT=0xYourAddress # MEV_BOOST=true # CHECKPOINT_SYNC_URL=https://beaconstate.info ``` -------------------------------- ### Install Eth Docker and Host Optimizations Source: https://context7.com/ethstaker/eth-docker/llms.txt Installs Docker CE, Docker Compose V2, and optional system packages. Can also apply host performance tunings and create a global 'ethd' alias. Ensure you are in the eth-docker checkout directory before running. ```bash # Run from the eth-docker checkout directory cd ~/eth-docker ./ethd install # Expected prompts: # - Install Docker? (yes/no) # - Apply performance optimizations? (yes/no) # - Add 'ethd' alias to ~/.profile? (yes/no) # # After completion, source the profile or log out/in: source ~/.profile # Then 'ethd' is available from anywhere ``` -------------------------------- ### Start Ethereum Node Services Source: https://context7.com/ethstaker/eth-docker/llms.txt Starts all configured Docker Compose services in detached mode, removing orphaned containers. Use 'ethd up ' to start a specific service. This command is equivalent to 'docker compose up -d --remove-orphans'. ```bash ./ethd up # Starts: execution, consensus, validator, mev-boost (based on CORE_FILES in .env) # Expected output: # [+] Running 4/4 # ✔ Container eth-docker-execution-1 Started # ✔ Container eth-docker-consensus-1 Started # ✔ Container eth-docker-validator-1 Started # ✔ Container eth-docker-mev-boost-1 Started # Start a single service: ./ethd up execution # Restart (stop + start): ./ethd restart consensus ``` -------------------------------- ### Docker Compose .yml Service Files - Modular Client Selection Source: https://context7.com/ethstaker/eth-docker/llms.txt The CORE_FILES variable in .env specifies a colon-separated list of .yml files to compose the full stack. Combinations allow for full validator nodes, RPC nodes, validator clients only, and specialized setups like SSV or Lido Obol DVT nodes. ```bash # Full validator node: Lighthouse CL + Reth EL + MEV-Boost + Grafana: CORE_FILES=lighthouse.yml:reth.yml:mev-boost.yml:grafana.yml:grafana-shared.yml # RPC node only (no validator): Teku + Besu: CORE_FILES=teku-cl-only.yml:besu.yml # Validator client only (remote CL): CORE_FILES=lighthouse-vc-only.yml # SSV DVT node: CORE_FILES=nimbus-cl-only.yml:reth.yml:ssv.yml:mev-boost.yml # Lido Obol DVT node: CORE_FILES=lighthouse-cl-only.yml:lighthouse-vc-only.yml:reth.yml:mev-boost.yml:lido-obol.yml:lido-obol-alloy.yml # Available EL yml files: # geth.yml, reth.yml, besu.yml, nethermind.yml, erigon.yml, ethrex.yml, nimbus-el.yml # Available CL yml files (with integrated VC): # lighthouse.yml, teku.yml, prysm.yml, lodestar.yml, nimbus.yml, grandine-allin1.yml, caplin.yml # CL-only (for split CL/VC setups): # lighthouse-cl-only.yml, teku-cl-only.yml, prysm-cl-only.yml, # lodestar-cl-only.yml, nimbus-cl-only.yml, grandine-cl-only.yml # VC-only: # lighthouse-vc-only.yml, teku-vc-only.yml, prysm-vc-only.yml, # lodestar-vc-only.yml, nimbus-vc-only.yml, vero-vc-only.yml # Optional add-ons (append to CORE_FILES): # mev-boost.yml, commit-boost-pbs.yml # grafana.yml (or grafana-rootless.yml), grafana-shared.yml # web3signer.yml # deposit-cli.yml # ethdo.yml # traefik-cf.yml, traefik-aws.yml # ext-network.yml (RocketPool integration) # contributoor.yml # ssv.yml, anchor.yml, ssv-dkg.yml # Custom overrides (do not get overwritten by ethd config): CUSTOM_FILES=custom.yml ``` -------------------------------- ### Print Running Client Versions Source: https://context7.com/ethstaker/eth-docker/llms.txt Queries each running container for its version string, including CL, EL, VC, DVT, Web3signer, MEV-Boost, and Grafana. ```bash ./ethd version # Example output: # This is Eth Docker v26.5.1-dev # # Lighthouse version: v6.0.1 # # Reth version: reth/v1.3.3/x86_64-unknown-linux-gnu # # mev-boost v1.9 ``` -------------------------------- ### Eth Docker Configuration Reference Source: https://context7.com/ethstaker/eth-docker/llms.txt Reference for tuneable parameters in `default.env`. Users should copy this to `.env` and edit it for custom configurations. ```bash # Key variables and their defaults: NETWORK=hoodi # mainnet | hoodi | sepolia | gnosis | ephemery | CHECKPOINT_SYNC_URL=https://hoodi.checkpoint.sigp.io FEE_RECIPIENT= # Required: 0x... ETH address for validator rewards MEV_BOOST=false # true to enable MEV-Boost GRAFFITI= # Up to 32 chars included in proposed blocks LOG_LEVEL=info # error | warn | info | debug | trace CL_NODE_TYPE=pruned # archive | full | pruned | pruned-with-zkproofs EL_NODE_TYPE=pre-merge-expiry # archive | full | pre-merge-expiry | pre-prague-expiry | rolling-expiry | aggressive-expiry EL_P2P_PORT=30303 CL_P2P_PORT=9000 GRAFANA_PORT=3000 KEY_API_PORT=7500 EL_RPC_PORT=8545 ``` -------------------------------- ### Lighthouse docker-entrypoint.sh Key Behaviors Source: https://context7.com/ethstaker/eth-docker/llms.txt The Lighthouse entrypoint script manages JWT secret synchronization, MEV-Boost integration, checkpoint sync URL usage, IPv6 support, and node type configurations for archiving or pruning. ```bash # Lighthouse entrypoint key behavior: # 1. Waits up to 30 s for EL to create the JWT secret file # 2. MEV_BOOST=true adds --builder http://mev-boost:18550 # 3. CHECKPOINT_SYNC_URL adds --checkpoint-sync-url= # 4. IPV6=true adds --listen-address :: dual-stack flags # 5. NODE_TYPE=archive adds --prune-blobs=false --reconstruct-historic-states # 6. Prune marker triggers: lighthouse db prune-states ``` -------------------------------- ### Geth docker-entrypoint.sh Key Behaviors Source: https://context7.com/ethstaker/eth-docker/llms.txt The Geth entrypoint script handles JWT secret generation, network configuration for custom testnets via sparse git checkout, and applies specific flags for node types (archive, pre-merge-expiry) and tracing. ```bash # Geth entrypoint key behavior: # 1. Auto-generates JWT secret if not provided in .env: # /var/lib/geth/ee-secret/jwtsecret # 2. For custom testnets (NETWORK=https://github.com/...), clones network config: # git sparse-checkout of genesis.json + enodes.yaml # 3. EL_NODE_TYPE=pre-merge-expiry on mainnet adds --history.chain postmerge # 4. EL_NODE_TYPE=archive adds --syncmode=full --gcmode=archive # 5. ERA_URL triggers EraE history import before starting # 6. Grafana tracing: adds --rpc.telemetry.endpoint http://tempo:4318 ``` -------------------------------- ### Attach to Geth Console Source: https://context7.com/ethstaker/eth-docker/llms.txt Opens an interactive Geth JavaScript console. Use this for debugging or querying the running Geth client. ```bash ./ethd attach-geth ``` -------------------------------- ### Update Eth Docker and Clients Source: https://context7.com/ethstaker/eth-docker/llms.txt Performs a git pull (or tag checkout), migrates .env, rebuilds/pulls Docker images, and checks for CVEs. Can optionally auto-upgrade PostgreSQL. Runs in 'screen' when invoked over SSH. Use '--refresh-targets' to reset client image tags/repos to defaults. ```bash # Standard update (keeps custom build targets): ./ethd update # Reset all client image tags/repos to defaults: ./ethd update --refresh-targets ``` -------------------------------- ### View Container Logs Source: https://context7.com/ethstaker/eth-docker/llms.txt A wrapper around 'docker compose logs'. Use '-f' to follow logs in real-time. Specify a service name to filter logs for that specific container. Useful for monitoring specific processes like Nethermind pruning or checkpoint sync. ```bash # Follow all logs: ./ethd logs -f # Last 100 lines for execution only: ./ethd logs -f --tail 100 execution # Watch Nethermind pruning: ./ethd logs -f --tail 500 execution | grep Full # Watch checkpoint sync progress: ./ethd logs -f --tail 50 consensus ``` -------------------------------- ### Display Disk Usage Source: https://context7.com/ethstaker/eth-docker/llms.txt Shows free space on the Docker data directory, Docker volume sizes, and the optional `ANCIENT_DIR` size. Useful for monitoring disk space consumption. ```bash ./ethd space ``` -------------------------------- ### Eth Docker Runtime Behavior Overrides Source: https://context7.com/ethstaker/eth-docker/llms.txt Runtime behavior for clients like Reth and Lighthouse can be overridden via .env variables without modifying the entrypoint scripts. These include node type, log level, and specific client flags. ```bash # Example: override node type via .env without changing entrypoint: # EL_NODE_TYPE=rolling-expiry -> Reth gets --history.chain rolling-expiry-based flag # CL_NODE_TYPE=archive -> Lighthouse keeps all blobs + reconstructs states # LOG_LEVEL=debug -> maps to --verbosity 4 for Geth, --debug for others ``` -------------------------------- ### Resync Consensus Client Source: https://context7.com/ethstaker/eth-docker/llms.txt Wipes and resyncs the consensus client. If `CHECKPOINT_SYNC_URL` is set, this process should take only minutes. Otherwise, it may take days. ```bash ./ethd resync-consensus ``` -------------------------------- ### Prune Lighthouse Beacon State Source: https://context7.com/ethstaker/eth-docker/llms.txt Stops Lighthouse, sets a prune marker inside its data volume, and restarts it. Lighthouse's `db prune-states` command will run on the next startup. ```bash ./ethd prune-lighthouse # Checks: Lighthouse running, synced, not archive # Sets prune marker in /var/lib/lighthouse/beacon/prune-marker ``` -------------------------------- ### Resync Execution Client Source: https://context7.com/ethstaker/eth-docker/llms.txt Wipes and resyncs the execution client. This process can take several hours depending on the client used. Ensure you understand the downtime implications before proceeding. ```bash ./ethd resync-execution ``` -------------------------------- ### Pass Arbitrary Docker Compose Commands Source: https://context7.com/ethstaker/eth-docker/llms.txt Allows passing arbitrary commands directly to `docker compose`. This is useful for advanced operations not covered by the `ethd` wrapper. ```bash # Show all running services: ./ethd cmd ps ``` ```bash # Execute a shell in the execution container: ./ethd cmd exec execution bash ``` ```bash # Pull a specific service image: ./ethd cmd pull consensus ``` ```bash # View effective merged compose config: ./ethd cmd config ``` ```bash # Scale (if applicable): ./ethd cmd up -d --scale validator=0 ``` ```bash # Show help for all compose subcommands: ./ethd cmd help ``` -------------------------------- ### Manage Validator Keys Source: https://context7.com/ethstaker/eth-docker/llms.txt Manages validator keys, fee recipients, gas limits, and graffiti via the EIP-3030 keymanager API. Supports import, delete, list, and count operations. Also handles pre-signed voluntary exit messages and Lido CSM key generation. ```bash # List public keys loaded in the VC: ./ethd keys list ``` ```bash # Count keys: ./ethd keys count ``` ```bash # Import keystores from .eth/validator_keys/: ./ethd keys import ``` ```bash # Import from a custom path: ./ethd keys import --path /mnt/usb/validator_keys ``` ```bash # Delete a single key (exports slashing protection data): ./ethd keys delete 0xabcd...1234 ``` ```bash # Delete all keys: ./ethd keys delete all ``` ```bash # Get/set per-validator fee recipient: ./ethd keys get-recipient 0xabcd...1234 ./ethd keys set-recipient 0xabcd...1234 0xYourRewardsAddress ./ethd keys delete-recipient 0xabcd...1234 ``` ```bash # Set per-validator gas limit: ./ethd keys set-gas 0xabcd...1234 30000000 ``` ```bash # Set per-validator graffiti: ./ethd keys set-graffiti 0xabcd...1234 "MyNode" ``` ```bash # Get keymanager API token (also the Prysm Web UI token): ./ethd keys get-api-token ``` ```bash # Sign voluntary exit messages from keystores (requires ethdo.yml): ./ethd keys sign-exit from-keystore ``` ```bash # Send pre-signed exit messages in .eth/exit_messages/: ./ethd keys send-exit ``` ```bash # Prepare BLS-to-execution address change (withdrawal credentials): ./ethd keys prepare-address-change ./ethd keys send-address-change ``` ```bash # Create keys for Lido CSM: ./ethd keys create-for-csm ``` ```bash # Non-interactive import (CI use, requires KEYSTORE_PASSWORD env var): KEYSTORE_PASSWORD="mysecretpass" ./ethd keys import --non-interactive ``` -------------------------------- ### Offline Prune Besu Trie-logs Source: https://context7.com/ethstaker/eth-docker/llms.txt Stops Besu, sets a prune marker file, then restarts it to execute trie-log pruning. Checks that Besu is synced and not an archive node. Use --non-interactive for automation. ```bash ./ethd prune-besu # Checks: Besu running, synced, not archive # Sets /var/lib/besu/prune-marker via docker compose run # Restarts Besu; observe with: ./ethd logs -f execution ``` ```bash ./ethd prune-besu --non-interactive ``` -------------------------------- ### Eth Docker .env Configuration Variables Source: https://context7.com/ethstaker/eth-docker/llms.txt These variables in the .env file control client versions, build sources, network connections, and resource tuning. Ensure JWT_SECRET is a 64-character hex string or leave empty for auto-generation. ```bash # Client image tags (override to pin versions): LH_DOCKER_TAG=latest GETH_DOCKER_TAG=stable RETH_DOCKER_TAG=latest TEKU_DOCKER_TAG=latest # Build from source instead of using Docker image: # LH_DOCKERFILE=Dockerfile.source # LH_SRC_BUILD_TARGET=stable # Advanced: split CL and EL across machines JWT_SECRET= # 64-char hex; auto-generated if empty EL_NODE=http://execution:8551 CL_NODE=http://consensus:5052 # Heap tuning for JVM clients: BESU_HEAP= # e.g. -Xmx12g TEKU_HEAP= # e.g. -Xmx8g # Prometheus metrics retention: PROMETHEUS_RETENTION_TIME=40d ENV_VERSION=57 # Internal schema version, do not change ``` -------------------------------- ### Online Prune Nethermind State DB Source: https://context7.com/ethstaker/eth-docker/llms.txt Triggers Nethermind's `admin_prune` JSON-RPC method while the node is running. Requires the node to be fully synced and a minimum of 250 GiB free disk space on mainnet. Use --non-interactive for automation. ```bash ./ethd prune-nethermind # Checks: Nethermind running + synced + sufficient free disk space # Sends: POST http://localhost:1337 {"method":"admin_prune",...} # Output: # Starting Nethermind prune # Nethermind returns {"result":"Starting","id":1,"jsonrpc":"2.0"} # Prune is running, observe with: # ./ethd logs -f --tail 500 execution | grep Full ``` ```bash # Non-interactive (CI/automation): ./ethd prune-nethermind --non-interactive ``` -------------------------------- ### Prune Lighthouse Data Source: https://context7.com/ethstaker/eth-docker/llms.txt Removes old data from the Lighthouse consensus client. Use this to free up disk space. ```bash ./ethd prune-lighthouse --non-interactive ``` -------------------------------- ### Update Eth Docker Stack Source: https://context7.com/ethstaker/eth-docker/llms.txt Updates the eth-docker stack. Use --non-interactive for CI/cron jobs. To pin to a specific version, set ETH_DOCKER_TAG in the .env file. ```bash ./ethd update --non-interactive ``` ```bash # In .env set: ETH_DOCKER_TAG=stable # Then run: ./ethd update ``` ```bash # In .env set: ETH_DOCKER_TAG=v26.4.0 ./ethd update ``` -------------------------------- ### Migrate Reth Database Source: https://context7.com/ethstaker/eth-docker/llms.txt Triggers a Reth database migration to the v2 format. This process can take up to 24 hours for archive nodes. Observe the execution client logs for progress. ```bash ./ethd migrate-reth ``` -------------------------------- ### Create a Git Alias for Pushing Cleanly Source: https://github.com/ethstaker/eth-docker/blob/main/CONTRIBUTING.md Define a global git alias 'push-clean' to rebase the current branch onto the upstream main branch and then force push. This helps maintain a clean commit history for pull requests. ```bash git config --global alias.push-clean '!git fetch upstream main && git rebase upstream/main && git push -f' ``` -------------------------------- ### Offline Prune Reth State DB Source: https://context7.com/ethstaker/eth-docker/llms.txt Stops Reth, sets a prune marker, and restarts to trigger in-place pruning. Validates sync status via `eth_syncing` before proceeding. Use --non-interactive for automation. ```bash ./ethd prune-reth # Checks: Reth running, synced, not archive # Sets /var/lib/reth/prune-marker # Restarts; observe with: ./ethd logs -f execution ``` ```bash ./ethd prune-reth --non-interactive ``` -------------------------------- ### Stop Ethereum Node Services Source: https://context7.com/ethstaker/eth-docker/llms.txt Stops and removes all configured Docker Compose services, including orphans. Use 'ethd stop ' to stop only a specific service. ```bash ./ethd down # Stops all services defined in CORE_FILES ./ethd stop validator # Stops only the validator service ``` -------------------------------- ### Configure Execution Layer History Expiry Source: https://context7.com/ethstaker/eth-docker/llms.txt Configures execution layer history expiry. Supports interactive TUI selection or CLI flags for non-interactive use. Modes include `pre-merge`, `pre-prague`, `rolling`, and `aggressive`. This command may trigger a full resync depending on the chosen mode and client. ```bash # Interactive TUI selection: ./ethd prune-history ``` ```bash # CLI flags (non-interactive): ./ethd prune-history --pre-merge --non-interactive ./ethd prune-history --pre-prague --non-interactive ./ethd prune-history --rolling --non-interactive ./ethd prune-history --aggressive --non-interactive ``` ```bash # Example: Geth with pre-Prague expiry (in-place, no resync needed): # EL_NODE_TYPE will be updated to pre-prague-expiry in .env # Geth restart is handled automatically # Observe: ./ethd logs -f execution ``` -------------------------------- ### Terminate Eth Docker Stack Source: https://context7.com/ethstaker/eth-docker/llms.txt Stops all containers and deletes all Docker volumes associated with the Eth Docker stack. This action is irreversible and will destroy all node data. ```bash ./ethd terminate ``` -------------------------------- ### Repair Reth Database Source: https://context7.com/ethstaker/eth-docker/llms.txt Initiates a repair process for a corrupted Reth database. This can take over 2 hours. Observe the execution client logs for progress. ```bash ./ethd repair-reth ``` -------------------------------- ### Add Upstream Remote for Git Source: https://github.com/ethstaker/eth-docker/blob/main/CONTRIBUTING.md Configure a git remote named 'upstream' to fetch changes from the main project repository. This is useful for rebasing before creating a pull request. ```bash git remote add upstream https://github.com/ethstaker/eth-docker.git ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.