-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
122 lines (117 loc) · 3.75 KB
/
Copy pathdocker-compose.yml
File metadata and controls
122 lines (117 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
services:
hardhat:
image: ethereumoptimism/hardhat-node:latest
container_name: web3-flight-hardhat
ports:
- "8545:8545"
networks:
- web3-flight
command: npx hardhat node --hostname 0.0.0.0 --port 8545
healthcheck:
test:
[
"CMD",
"sh",
"-c",
"wget --spider -q http://127.0.0.1:8545 2>&1 || exit 1",
]
interval: 5s
timeout: 3s
retries: 15
start_period: 15s
flight-server:
build:
context: .
dockerfile: Dockerfile
container_name: web3-flight-server
command: server.jar
ports:
- "8815:8815"
- "9091:9091"
environment:
# --- Required ---
- WEBSOCKET_NODE_URL=ws://hardhat:8545
- HTTP_NODE_URL=http://hardhat:8545
- FLIGHT_PORT=8815
# --- Observability ---
# Prometheus exporter at /metrics (default: 9091).
- METRICS_PORT=9091
# --- Cache ---
- DB_PATH=/app/rocksdb_cache
- INITIAL_BLOCK=0
# RETENTION_BLOCKS: unset -> keep forever (dev default).
# In prod, set to a multiple of 1000, e.g. 100000 (~2 weeks of L1 blocks).
# - RETENTION_BLOCKS=100000
# BACKFILL_BLOCKS: on a fresh cache only, also fetch the previous N blocks
# backward from the start head into the hot cache. 0 (default) disables.
# If S3 is configured, the backfill loop pulls each block from S3 first
# and falls back to RPC on miss.
# - BACKFILL_BLOCKS=1000
# --- Cold tier (S3) ---
# ARCHIVE_MODE: off|optional|required
# off - no S3 writes; pruned data is lost permanently (dev).
# optional - S3 if configured, otherwise warn and drop cold tier (default).
# required - fail startup if S3 isn't fully configured (prod).
- ARCHIVE_MODE=off
# ARCHIVE_COMPRESSION: none|lz4|zstd|zstd:<1-22> — body compression for
# chunks written to S3 (default none). Write-side only: readers handle
# any codec, so this is safe to change or unset at any time and a
# bucket may hold a mix. zstd is ~2.5x smaller; recommended for prod.
# - ARCHIVE_COMPRESSION=zstd
# - S3_BUCKET=my-web3-flight-archive
# - S3_REGION=us-east-1
# - AWS_ACCESS_KEY=...
# - AWS_SECRET_KEY=...
# S3_ENDPOINT / S3_FORCE_PATH_STYLE: set when targeting an
# S3-compatible backend like Cloudflare R2 or Minio. Both server and
# backfill must use identical values.
# - S3_ENDPOINT=https://<account_id>.r2.cloudflarestorage.com # R2
# - S3_FORCE_PATH_STYLE=true # Minio
volumes:
- rocksdb_data:/app/rocksdb_cache
networks:
- web3-flight
depends_on:
hardhat:
condition: service_healthy
restart: unless-stopped
test-data-generator:
image: node:20-alpine
container_name: web3-flight-test-generator
working_dir: /app
volumes:
- ./test-data:/app
command: sh -c "npm install && node generate-test-data.js"
environment:
- ETH_NODE_URL=http://hardhat:8545
networks:
- web3-flight
depends_on:
hardhat:
condition: service_healthy
jupyter:
image: jupyter/scipy-notebook:latest
container_name: web3-flight-jupyter
ports:
- "8888:8888"
volumes:
- ./notebooks:/home/jovyan/work
environment:
- JUPYTER_ENABLE_LAB=yes
- JUPYTER_TOKEN=ethereum
- GRPC_DNS_RESOLVER=native
networks:
web3-flight:
aliases:
- jupyter-client
depends_on:
flight-server:
condition: service_started
hardhat:
condition: service_healthy
command: start-notebook.sh --NotebookApp.token='ethereum' --NotebookApp.password=''
networks:
web3-flight:
driver: bridge
volumes:
rocksdb_data: