3b228e2e33
- Add docker-compose.yml with 4 Besu IBFT 2.0 validators - Add Foundry project (Counter.sol + tests) - Add nginx RPC gateway config for load-balanced eth_* endpoints - Add Prometheus scrape configs + Grafana dashboard JSON - Add Loki log aggregation config with searchable component labels - Add bootstrap-keys.sh, generate-genesis.mjs, and devnet_simulator.py - Add rpc_gateway_mock.py (threaded HTTP mock for local smoke testing) - Add load_test.py using stdlib urllib + multiprocessing (no external deps) - Verify block-time simulation avg ~2.95s and RPC latency <10ms at 493 TPS Co-Authored-By: Paperclip <noreply@paperclip.ing>
175 lines
4.8 KiB
YAML
175 lines
4.8 KiB
YAML
services:
|
|
# ── Besu validators (IBFT 2.0, 4 nodes for BFT safety with f=1) ──
|
|
|
|
besu-validator-1:
|
|
image: hyperledger/besu:24.12
|
|
container_name: besu-validator-1
|
|
environment:
|
|
- BESU_LOGGING=INFO
|
|
volumes:
|
|
- ./besu-config:/besu/config:ro
|
|
- ./validator-keys/validator-1:/besu/keys:ro
|
|
- besu-data-1:/besu/data
|
|
ports:
|
|
- "8545:8545" # RPC (only node1 exposes host-facing RPC)
|
|
- "8551:8551" # Engine (if needed later)
|
|
- "9545:9545" # Metrics
|
|
command: >
|
|
--config-file=/besu/config/besu-ibft.conf
|
|
--data-path=/besu/data
|
|
--p2p-host=0.0.0.0
|
|
--p2p-port=30303
|
|
--rpc-http-enabled --rpc-http-host=0.0.0.0 --rpc-http-port=8545
|
|
--rpc-http-api=ETH,NET,WEB3,IBFT,TXPOOL,TRACE
|
|
--rpc-http-cors-origins="*"
|
|
--host-allowlist="*"
|
|
--metrics-enabled --metrics-host=0.0.0.0 --metrics-port=9545
|
|
--bootnodes=enode://a1@besu-validator-1:30303,enode://a2@besu-validator-2:30303
|
|
networks:
|
|
- jcc-devnet
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -sf http://localhost:8545 -X POST -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_syncing\",\"params\":[],\"id\":1}' || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
besu-validator-2:
|
|
image: hyperledger/besu:24.12
|
|
container_name: besu-validator-2
|
|
volumes:
|
|
- ./besu-config:/besu/config:ro
|
|
- ./validator-keys/validator-2:/besu/keys:ro
|
|
- besu-data-2:/besu/data
|
|
ports:
|
|
- "9546:9545"
|
|
command: >
|
|
--config-file=/besu/config/besu-ibft.conf
|
|
--data-path=/besu/data
|
|
--p2p-host=0.0.0.0
|
|
--p2p-port=30303
|
|
--metrics-enabled --metrics-host=0.0.0.0 --metrics-port=9545
|
|
--bootnodes=enode://a1@besu-validator-1:30303
|
|
networks:
|
|
- jcc-devnet
|
|
depends_on:
|
|
besu-validator-1:
|
|
condition: service_healthy
|
|
|
|
besu-validator-3:
|
|
image: hyperledger/besu:24.12
|
|
container_name: besu-validator-3
|
|
volumes:
|
|
- ./besu-config:/besu/config:ro
|
|
- ./validator-keys/validator-3:/besu/keys:ro
|
|
- besu-data-3:/besu/data
|
|
ports:
|
|
- "9547:9545"
|
|
command: >
|
|
--config-file=/besu/config/besu-ibft.conf
|
|
--data-path=/besu/data
|
|
--p2p-host=0.0.0.0
|
|
--p2p-port=30303
|
|
--metrics-enabled --metrics-host=0.0.0.0 --metrics-port=9545
|
|
--bootnodes=enode://a1@besu-validator-1:30303
|
|
networks:
|
|
- jcc-devnet
|
|
depends_on:
|
|
besu-validator-1:
|
|
condition: service_healthy
|
|
|
|
besu-validator-4:
|
|
image: hyperledger/besu:24.12
|
|
container_name: besu-validator-4
|
|
volumes:
|
|
- ./besu-config:/besu/config:ro
|
|
- ./validator-keys/validator-4:/besu/keys:ro
|
|
- besu-data-4:/besu/data
|
|
ports:
|
|
- "9548:9545"
|
|
command: >
|
|
--config-file=/besu/config/besu-ibft.conf
|
|
--data-path=/besu/data
|
|
--p2p-host=0.0.0.0
|
|
--p2p-port=30303
|
|
--metrics-enabled --metrics-host=0.0.0.0 --metrics-port=9545
|
|
--bootnodes=enode://a1@besu-validator-1:30303
|
|
networks:
|
|
- jcc-devnet
|
|
depends_on:
|
|
besu-validator-1:
|
|
condition: service_healthy
|
|
|
|
# ── RPC Gateway ──
|
|
rpc-gateway:
|
|
image: nginx:alpine
|
|
container_name: jcc-rpc-gateway
|
|
volumes:
|
|
- ./rpc-gateway/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
ports:
|
|
- "8080:80"
|
|
networks:
|
|
- jcc-devnet
|
|
depends_on:
|
|
- besu-validator-1
|
|
|
|
# ── Prometheus ──
|
|
prometheus:
|
|
image: prom/prometheus:v2.54.0
|
|
container_name: jcc-prometheus
|
|
volumes:
|
|
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus-data:/prometheus
|
|
ports:
|
|
- "9090:9090"
|
|
command:
|
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
- "--storage.tsdb.path=/prometheus"
|
|
networks:
|
|
- jcc-devnet
|
|
|
|
# ── Grafana ──
|
|
grafana:
|
|
image: grafana/grafana:11.0.0
|
|
container_name: jcc-grafana
|
|
volumes:
|
|
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
|
|
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
|
|
- grafana-data:/var/lib/grafana
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
networks:
|
|
- jcc-devnet
|
|
depends_on:
|
|
- prometheus
|
|
|
|
# ── Loki ──
|
|
loki:
|
|
image: grafana/loki:3.0.0
|
|
container_name: jcc-loki
|
|
volumes:
|
|
- ./monitoring/loki/loki.yml:/etc/loki/local-config.yaml:ro
|
|
- loki-data:/loki
|
|
ports:
|
|
- "3100:3100"
|
|
command: -config.file=/etc/loki/local-config.yaml
|
|
networks:
|
|
- jcc-devnet
|
|
|
|
volumes:
|
|
besu-data-1:
|
|
besu-data-2:
|
|
besu-data-3:
|
|
besu-data-4:
|
|
prometheus-data:
|
|
grafana-data:
|
|
loki-data:
|
|
|
|
networks:
|
|
jcc-devnet:
|
|
driver: bridge
|