-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (57 loc) · 1.76 KB
/
Copy pathMakefile
File metadata and controls
70 lines (57 loc) · 1.76 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
.PHONY: help build run-live run-stats run-backfill docker-build docker-up docker-down docker-logs db-up db-migrate sqlx-prepare clean
# Default target
help:
@echo "Solana LUT Indexer - Available commands:"
@echo ""
@echo "Local Development:"
@echo " make build - Build the project"
@echo " make run-live - Run live indexer"
@echo " make run-stats - Show indexer statistics"
@echo " make run-backfill - Run backfill (edit Makefile for slot range)"
@echo ""
@echo "Database:"
@echo " make db-up - Start PostgreSQL in Docker"
@echo " make db-migrate - Run database migrations"
@echo " make sqlx-prepare - Generate SQLx query cache"
@echo ""
@echo "Docker:"
@echo " make docker-build - Build Docker image"
@echo " make docker-up - Start all services"
@echo " make docker-down - Stop all services"
@echo " make docker-logs - View indexer logs"
@echo ""
@echo "Cleanup:"
@echo " make clean - Remove build artifacts"
# Local development
build:
cargo build --release
run-live:
cargo run --release -- live
run-stats:
cargo run --release -- stats
run-backfill:
cargo run --release -- backfill --start-slot 200000000 --end-slot 200100000
# Database operations
db-up:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d postgres
@echo "Waiting for PostgreSQL to be ready..."
@sleep 3
@echo "PostgreSQL is running on localhost:5432"
@echo "DATABASE_URL=postgres://indexer:indexer@localhost:5432/lut_indexer"
db-migrate:
sqlx migrate run
sqlx-prepare:
cargo sqlx prepare
# Docker operations
docker-build:
docker compose build
docker-up:
docker compose up -d
docker-down:
docker compose down
docker-logs:
docker compose logs -f indexer
# Cleanup
clean:
cargo clean
rm -rf .sqlx