-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (75 loc) · 2.52 KB
/
Copy pathMakefile
File metadata and controls
97 lines (75 loc) · 2.52 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
.PHONY: help build test lint fmt vet tidy run-indexer run-processor run-api run-mcp docker-up docker-down clean proto integration-test demo demo-down demo-logs bench-mem bench-mem-lite
GO ?= go
BIN_DIR := bin
help:
@echo "Targets:"
@echo " build build all binaries to ./bin/"
@echo " test go test ./..."
@echo " lint go vet + go fmt -l check"
@echo " fmt gofmt -w on whole tree"
@echo " vet go vet ./..."
@echo " tidy go mod tidy"
@echo " run-indexer run indexer locally"
@echo " run-processor run processor locally"
@echo " run-api run api locally"
@echo " run-mcp run mcp locally"
@echo " docker-up docker compose up -d"
@echo " docker-down docker compose down"
@echo " proto regenerate gRPC pb files (requires protoc + protoc-gen-go[-grpc])"
@echo " integration-test spin up compose, run end-to-end test, tear down"
@echo " demo bring up full stack and print copy-paste demo commands"
@echo " demo-down tear demo stack down"
@echo " demo-logs tail logs of the four ChainPulse binaries"
@echo " bench-mem sample container RSS for the default stack"
@echo " bench-mem-lite sample container RSS with the Redpanda lite overlay"
@echo " clean remove ./bin"
build:
mkdir -p $(BIN_DIR)
$(GO) build -o $(BIN_DIR)/indexer ./cmd/indexer
$(GO) build -o $(BIN_DIR)/processor ./cmd/processor
$(GO) build -o $(BIN_DIR)/api ./cmd/api
$(GO) build -o $(BIN_DIR)/mcp ./cmd/mcp
test:
$(GO) test ./... -race -count=1
lint: vet
@diff -u <(echo -n) <(gofmt -l .)
fmt:
gofmt -w .
vet:
$(GO) vet ./...
tidy:
$(GO) mod tidy
run-indexer:
$(GO) run ./cmd/indexer --config config/config.toml
run-processor:
$(GO) run ./cmd/processor --config config/config.toml
run-api:
$(GO) run ./cmd/api --config config/config.toml
run-mcp:
$(GO) run ./cmd/mcp --config config/config.toml
docker-up:
docker compose up -d
docker-down:
docker compose down
proto:
protoc \
--proto_path=internal/api/grpc/proto \
--go_out=internal/api/grpc/pb \
--go_opt=paths=source_relative \
--go-grpc_out=internal/api/grpc/pb \
--go-grpc_opt=paths=source_relative \
internal/api/grpc/proto/chainpulse.proto
clean:
rm -rf $(BIN_DIR)
integration-test:
./test/integration/run.sh
demo:
./scripts/demo.sh
demo-down:
docker compose down
demo-logs:
docker compose logs -f indexer processor api mcp
bench-mem:
./scripts/bench-mem.sh
bench-mem-lite:
LITE=1 ./scripts/bench-mem.sh