Repository navigation
Expand file tree
/
Copy pathfly.toml
More file actions
73 lines (66 loc) · 2.59 KB
/
Copy pathfly.toml
File metadata and controls
73 lines (66 loc) · 2.59 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
# Fly.io deployment for Lumenqraph. One image (the repo Dockerfile), three
# process groups sharing a managed Postgres. See docs/DEPLOY.md for the full
# walkthrough (Neon/Supabase Postgres, secrets, scaling).
#
# fly launch --no-deploy --copy-config # reuse this file
# fly secrets set DATABASE_URL=... RPC_URL=...
# fly deploy
#
# Rename `app` to your own app before deploying.
app = "lumenqraph"
primary_region = "iad"
[build]
dockerfile = "Dockerfile"
# Three long-running services from the one image. The indexer and webhooks are
# workers (no inbound service); the api serves HTTP + the explorer UI.
[processes]
api = "lumenqraph-api"
indexer = "lumenqraph-indexer"
webhooks = "lumenqraph-webhooks"
# Non-secret config. Secrets (DATABASE_URL, and CONTRACT_IDS if you prefer) go
# via `fly secrets set`. CONTRACT_IDS left unset here = index ALL contract
# events; set it to a comma-separated allowlist for a focused, cheaper index.
[env]
API_BIND_ADDR = "0.0.0.0:8080"
RPC_URL = "https://mainnet.sorobanrpc.com"
RUST_LOG = "info"
STATE_INDEXING = "true"
KEY_INDEXING = "true"
# Kept small so the indexer converges fast on the rate-limited public RPC —
# a hyperactive SAC like CAS3 emits ~500 events/ledger, so a large catch-up
# would saturate Postgres for hours before committing. Larger gaps are
# skipped + logged. Raise it only with a retaining/paid RPC (see DEPLOYMENT.md).
MAX_CATCHUP_LEDGERS = "120"
EXPLORER_DIR = "/app/explorer"
# HTTP is served only by the `api` process group. The indexer must run 24/7
# (a sleeping poller falls behind the chain), so machines are never auto-stopped.
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 1
processes = ["api"]
[[http_service.checks]]
interval = "15s"
timeout = "5s"
grace_period = "30s"
method = "GET"
path = "/health"
# Resource allocation: the indexer does more work (WASM parsing, event decode,
# state snapshots) than the stateless api and webhooks. Memory limits prevent
# one process group from triggering OOM kills in others.
#
# Recommended: Fly.io Standard or Premium tier (shared-cpu-1x with 2GB+ available).
# Adjust these if using smaller instances (see DEPLOYMENT.md for tuning guidance).
#
# Memory spikes occur during WASM spec parsing; if the indexer OOM kills on startup,
# reduce SPEC_CACHE_MAX_ENTRIES (default 2000) or increase available memory.
[[vm]]
size = "shared-cpu-1x"
memory = "1024mb"
processes = ["indexer"]
[[vm]]
size = "shared-cpu-1x"
memory = "512mb"
processes = ["api", "webhooks"]