Ethereum Validator Setup Guide
Complete Hoodi Testnet Implementation Documentation
# Ethereum Validator Setup on Hoodi Testnet
This guide provides step-by-step instructions for setting up an Ethereum validator node on the Hoodi testnet using Docker Compose. The setup includes an execution client, beacon node, Web3Signer for key management, and a validator client.
## Prerequisites
- **Hardware Requirements**:
- **RAM**: 16GB+ (32GB recommended)
- **Storage**: 100GB+ SSD (NVMe preferred)
- **Software Requirements**:
- Docker and Docker Compose
- Go (optional, only needed for key generation tools)
## Configuration
### 1. Generate Keys
#### Optional: Use the Built-in Key Generator
```bash
# Build the key generation tool
go build -C eth-key-gen -o ../key_gen cmd/key_gen.go
# Generate withdrawal address key pair (ECDSA)
./key_gen addr
# Generate signing key pair (BLS)
# ./key_gen sign
```
> **Security Note:** Run this on an air-gapped machine (no internet connection) to protect your private keys.
### 2. Environment Variables
Create a `.env` file in the project root:
```bash
# Slashing protection database password
DB_PASSWORD=your_secure_password_here
# Fee recipient address (where validator rewards go)
FEE_RECIPIENT=0xYourEthereumAddressHere
```
## Installation and Setup
### 1. Run the Setup Script
```bash
# Make the script executable
chmod +x setup.sh
# Run the setup
./setup.sh
```
The setup script will:
- Generate JWT secrets for secure communication
- Initialize the PostgreSQL database with Web3Signer schema
- Start all services via Docker Compose
### 2. Verify Services
Check that all services are running:
```bash
docker-compose ps
```
All services should eventually show "healthy" status after startup, but it may take several minutes for them to become healthy.
## Service Architecture
### 1. Execution Client (Geth)
- **Purpose**: Processes Ethereum transactions and maintains the execution layer
- **Port**: 8545 (HTTP), 8551 (Auth RPC), 30303 (P2P)
- **Sync Mode**: Snap sync for faster initial synchronization
- **Network**: Hoodi testnet
### 2. Beacon Node (Lighthouse)
- **Purpose**: Manages the consensus layer and validator coordination
- **Port**: 5052 (HTTP), 9090 (Metrics)
- **Checkpoint Sync**: Uses official checkpoint sync endpoint for faster startup
- **Network**: Hoodi testnet
### 3a. PostgreSQL Database
- **Purpose**: Provides slashing protection database for Web3Signer
- **Port**: 5432 (internal only, not exposed externally)
- **Features**: Persistent storage for validator attestation history
- **Security**: Password-protected with environment variable configuration
- **Data Persistence**: Mounted volume for data durability across restarts
**Don't test signing before staking unless the genesis_validators_root in the payload is the current one!!**
**If you do manual test with Web3signer, it is recommended to remove slashing protection database data (rm -rf postgres-data) and run command for loading schema in setup.sh before staking**
### 3b. Web3Signer
- **Purpose**: Remote key management and signing service
- **Port**: 9000 (HTTP)
- **Features**: Slashing protection, key management API
- **Database**: PostgreSQL for slashing protection
### 4. Validator Client (Lighthouse)
- **Purpose**: Manages validator operations and attestations
- **Port**: 5062 (HTTP)
- **Integration**: Connects to beacon node and Web3Signer
## Staking Process
### 1. Fund Your Validator
1. Visit the [Hoodi PoW Faucet](https://hoodi-faucet.pk910.de/)
2. Request testnet ETH for your validator address
3. Ensure you have at least 32 ETH for staking
### 2. Get deposit file and keystore file for validator
1. Use the [Hoodi Staking Launchpad](https://hoodi.launchpad.ethstaker.cc/en/overview)
2. Follow the instructions to generate deposit data file and keystore file
3. **Save password and mnemonic for that keystore file somewhere safe**
### 3. Import keystore file to web3signer
1. Copy your keystore JSON file (e.g., `keystore-m_12381_3600_0_0_0-.json`) into the `web3signer-storage` directory.
2. In the same directory, create a text file (e.g., `keystore.password`) containing only the keystore password (no extra spaces or newlines).
3. In the `web3signer-keys` directory, create a YAML file (e.g., `my_validator.yaml`) with the following content, updating the file paths as needed:
```
type: "file-keystore"
keyType: "BLS"
keystoreFile: "/web3signer/storage/"
keystorePasswordFile: "/web3signer/storage/"
```
Example (`./web3signer-keys/my_validator.yaml`):
```
type: "file-keystore"
keyType: "BLS"
keystoreFile: "/web3signer/storage/keystore-m_12381_3600_0_0_0-.json"
keystorePasswordFile: "/web3signer/storage/keystore.password"
```
> **Official Documentation**: "The configuration file must be YAML-formatted, and can use any naming format, but must have the .yaml extension."
4. Run `chown -R 1001:1001 web3signer-storage` to ensure the web3signer container has access to the keystore files.
5. Run `docker-compose --env-file .env restart web3signer` to reload the keystore file in the web3signer service.
6. You should see this from the logs
```log
web3signer-1 | ... | INFO | SignerLoader | Total Artifact Signers loaded via configuration files: 1
web3signer-1 | Total Paths cached: 1, Error count: 0
```
### 4. Configure Validator to Use Web3Signer as Remote Signer
Update your validator client configuration to use Web3Signer as the remote signer.
Edit (or create if missing) the file `./validator-data/hoodi/validators/validator_definitions.yml` and add the following entry:
```yaml
- enabled: true
voting_public_key: 0x
description: ''
type: web3signer
url: http://web3signer:9000
```
> **Tip:** To get your validator's public key from the keystore file, run:
>
> ```
> cat web3signer-storage/keystore-m_12381_3600_0_0_0-.json | jq .pubkey | tr -d \"
> ```
>
> Replace `` with your actual keystore file's timestamp.
Then restart validator container `docker-compose --env-file .env restart validator`. You should see these from its logs
```log
validator-1 | ... INFO Initialized validators disabled: 0, enabled: 1
validator-1 | ... Awaiting activation
```
### 5. Submit Validator Registration
1. Return to **Hoodi Staking Launchpad**
2. Upload your deposit data file
3. When submitting the transaction to register your validator, ensure you are sending your ETH to the official deposit contract address: `0x00000000219ab540356cBB839Cbe05303d7705Fa`
### 6. Wait for Activation
- Monitor your validator logs
- Go to https://hoodi.beaconcha.in/validator and search for your validator public key to view its status and activation progress.
## Troubleshooting
### Common Issues
1. **Sync Issues**
- Monitor execution client and beacon node logs:
```
docker-compose --env-file .env logs -f execution beacon
```
- Verify network connectivity
- Monitor disk space
## Support and Resources
- **Hoodi Testnet**: [Hoodi Testnet](https://hoodi.ethpandaops.io/)
- **Ethereum Staking**: [Become a validator](https://hoodi.launchpad.ethereum.org/en/overview)
- **Lighthouse**: [Lighthouse Book](https://lighthouse-book.sigmaprime.io/)
- **Web3Signer**: [ConsenSys Documentation](https://docs.web3signer.consensys.io/)
- **Hoodi validator dashboard**: [Testnet Ethereum Hoodi Dashboard](https://v2-beta-hoodi.beaconcha.in/dashboard/)
- **Web3signer Endpoints**: [Web3signer endpoints with sample payload](https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Signing)
## Important Notes
⚠️ **Critical Warnings**:
- **Never test signing before staking** unless the genesis_validators_root is identical; otherwise, remove the slashing protection database data before staking with `rm -rf postgres-data`
---
*This documentation covers the basic setup for running an Ethereum validator on the Hoodi testnet. For production environments, additional security measures and monitoring should be implemented.*
Complete technical documentation for educational blockchain research.
DALHousie Department of Attestation & Ledger Studies — In Signatura, Veritas