A complete Docker-based setup for running a private EVM test network with block explorer using Geth and Epirus.
- Docker
- Docker Compose
- Create Docker network and volume:
# Create the network
docker network create virtual_office
# Create the persistent volume for blockchain data
docker volume create evm-node-data- Start the services:
# Build and start all services
docker-compose up -d
# Check logs
docker-compose logs -f emv_node- Stop the services:
docker-compose downMain Ethereum node running Geth with Clique PoA consensus.
Ports:
8545: HTTP RPC endpoint8546: WebSocket endpoint
Environment Variables:
CHAIN_ID: Network chain ID (default: 7979)BLOCK_PERIOD: Block time in seconds (default: 12)ACCOUNTS: Pre-funded accounts in formataddress:balance,address:balance- Format:
0xAddress:amountInWei - Example:
0xeED002fc450B60A7E8a4289A6CEeAF471c461aB0:1000000000000000000000
- Format:
evm_web: Web interface (Port 8100)evm_api: API backend (Port 8101)evm_ingestion: Data indexing serviceevm_mongodb: Database for explorer dataevm_redis: Cache service
Add custom network with these settings:
- Network Name: EVM Test Network
- RPC URL:
http://localhost:8545 - Chain ID:
7979 - Currency Symbol:
ETH - Block Explorer URL:
http://localhost:8100
HTTP RPC: http://localhost:8545
WebSocket: ws://localhost:8546
Web Interface: http://localhost:8100
The network comes with pre-funded accounts (configured via ACCOUNTS environment variable):
Default accounts:
0xeED002fc450B60A7E8a4289A6CEeAF471c461aB0: 1000 ETH0x1d9463bD28934EDf65D731F1881d047614c1c10e: 1 ETH
# Get latest block number
curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
http://localhost:8545
# Get account balance
curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xeED002fc450B60A7E8a4289A6CEeAF471c461aB0","latest"],"id":1}' \
http://localhost:8545- Add the custom network (see configuration above)
- Import account using private keys or create new accounts
- Request test ETH from the pre-funded accounts
- Consensus: Clique Proof of Authority (PoA)
- Block Time: 12 seconds
- Gas Limit: 8,000,000
- Chain ID: 7979
- Network ID: 7979
.
├── docker-compose.yaml # Main orchestration file
├── Dockerfile # EVM node container definition
├── entrypoint.sh # Node startup script
└── README.md # This file
Service won't start:
- Ensure the
virtual_officenetwork exists:docker network create virtual_office - Ensure the volume exists:
docker volume create evm-node-data
Can't connect from MetaMask:
- Verify the node is running:
docker-compose logs emv_node - Check if port 8545 is accessible:
curl http://localhost:8545
Explorer not loading:
- Wait a few minutes for all services to fully start
- Check all services are running:
docker-compose ps - View logs:
docker-compose logs evm_web
Node data persistence:
- Blockchain data persists in the
evm-node-dataDocker volume - To reset the blockchain:
docker volume rm evm-node-datathen recreate it
Modify the ACCOUNTS environment variable in docker-compose.yaml:
environment:
- ACCOUNTS=0xAddress1:1000000000000000000000,0xAddress2:2000000000000000000000,0xAddress3:500000000000000000000Modify the BLOCK_PERIOD environment variable:
environment:
- BLOCK_PERIOD=5 # 5 second blocksUpdate the CHAIN_ID environment variable:
environment:
- CHAIN_ID=1337This setup is for development and testing only. It uses:
- Insecure account unlocking
- Simple passwords
- Open CORS policies
- No authentication
Do not use in production environments.