How aplonks/ether-compose works
Project Type and Purpose
• This is a Docker-Compose-orchestrated, multi-container Ethereum Proof-of-Stake (PoS) development network.
• It spawns an execution client (Geth), a consensus client (Prysm Beacon Chain & Validator), optional block explorer, and an Ether-faucet service on a single Docker network (bcnetwork) for local dev and testing.
File-Tree / Directory Analysis
• Top-level:
• .env, docker-compose.yml, clean.sh – config & orchestration
• consensus/ – Prysm beacon-chain genesis & config
• execution/ – Geth genesis, keystore, JWT secret
• Directories separate “execution” vs “consensus” layers, plus optional “explorer” & “faucet” profiles.
Key README Insights
• Starts from PoS genesis (Deneb fork).
• 64 pre-generated validators seeded.
• Exposes JSON-RPC/Websocket (Geth), Engine API auth port (JWT), Prysm REST & gRPC, explorer UI, faucet frontend/backend + Redis.
a. Docker Host & bcnetwork bridge
b. Execution Layer:
– Container “geth” (go-ethereum)
– Genesis init tasks (geth-genesis-pos, create-beacon-chain-genesis)
c. Consensus Layer:
– Container “beacon-chain” (Prysm beacon client)
– Container “validator-1” (Prysm validator client)
d. Developer Tools / Services Layer (optional profiles):
– “lite-explorer” UI (8081)
– “ether-faucet-frontend” (5001) & “ether-faucet-backend” (5002) + “redis-stack” (8001)
e. External Interfaces:
– Host ports mapped to containers (e.g. 8545, 3500, 4000, etc.)
Interactions & Data Flows
• Geth ←→ Prysm Beacon Chain via JWT-secured Engine API (port 8551)
• Beacon Chain exposes REST (3500) & gRPC (4000) to Validator
• Validator duties orchestrated by Beacon Chain over gRPC
• Explorer ↔ Geth JSON-RPC (8545/8546) and Beacon REST for chain data
• Faucet Backend ↔ Geth JSON-RPC to submit transactions; Frontend ↔ Backend over HTTP; Backend ↔ Redis for state
Architectural Patterns & Principles
• Layered architecture: Execution vs Consensus layers clearly separated
• Microservices / containerization: each component in its own Docker container
• Configuration-as-code: genesis files & YAML drive initialization
• Docker network isolation (bcnetwork) enforces service-to-service communication
Technologies & Frameworks
• Docker & Docker-Compose
• go-ethereum (Geth) for execution client
• Prysm (beacon & validator) for consensus
• Alethio Lite Explorer for block visualization
• Custom Ether-faucet (Node.js + Redis)