-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (51 loc) Β· 1.95 KB
/
Makefile
File metadata and controls
63 lines (51 loc) Β· 1.95 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
.PHONY: setup build-program deploy-local run-gateway run-frontend restart stop all
# π ZeroRouter - Speed of Light AI Utility
setup:
@echo "π§ Installing dependencies..."
cd frontend && npm install
cd program && yarn install
@echo "β
Setup complete."
build-program:
@echo "ποΈ Building Anchor program..."
cd program && anchor build
deploy-local:
@echo "π Deploying to Localnet..."
cd program && anchor deploy
run-gateway:
@echo "π Starting ZeroRouter Gateway (Rust)..."
cd gateway && cargo run
run-frontend:
@echo "π₯οΈ Starting Next.js Frontend..."
cd frontend && npm run dev
stop:
@echo "π Stopping all ZeroRouter services..."
@pkill -f "zerorouter-gateway" || true
@pkill -f "next-router-worker" || true
@pkill -f "next" || true
@lsof -ti:3000 | xargs kill -9 2>/dev/null || true
@lsof -ti:8080 | xargs kill -9 2>/dev/null || true
@rm -rf frontend/.next || true
@echo "β
Stopped and Cache Cleared."
restart: stop
@echo "π Restarting ZeroRouter with Docker..."
DOCKER_HOST=unix:///Users/johnny/.docker/run/docker.sock docker compose up -d --build
@echo "β
ZeroRouter is spinning up in Docker."
@echo "π₯οΈ Frontend: http://localhost:3000"
@echo "π Gateway: http://localhost:8080"
native: stop
@echo "π Starting ZeroRouter Natively (Fallback)..."
@cd gateway && cargo run > gateway.log 2>&1 &
@echo "π Gateway starting in background (tail -f ZeroRouter/gateway/gateway.log)..."
@cd frontend && npm run dev
prune:
@echo "π§Ή Cleaning up Docker system (Freeing space)..."
@docker system prune -af --volumes || true
@echo "β
Cleanup complete."
upgrade:
@echo "π Upgrading Docker and cleaning socket..."
@killall Docker || true
@sudo rm -f /var/run/docker.sock
@brew upgrade --cask docker || echo "Manual upgrade required from https://www.docker.com/products/docker-desktop/"
@open -a Docker
@echo "β Docker is restarting. Wait 60s."
all: setup build-program deploy-local run-gateway run-frontend