forked from megaeth-labs/eigenda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (80 loc) · 2.68 KB
/
Makefile
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
.PHONY: compile-el compile-dl clean protoc lint build unit-tests integration-tests-churner integration-tests-indexer integration-tests-inabox integration-tests-inabox-nochurner integration-tests-graph-indexer
ifeq ($(wildcard .git/*),)
$(warning semver disabled - building from release zip)
GITCOMMIT := ""
GITDATE := ""
SEMVER := $(shell basename $(CURDIR))
else
GITCOMMIT := $(shell git rev-parse --short HEAD)
GITDATE := $(shell git log -1 --format=%cd --date=unix)
SEMVER := $(shell docker run --rm --volume "$(PWD):/repo" gittools/gitversion:5.12.0 /repo -output json -showvariable SemVer)
ifeq ($(SEMVER), )
$(warning semver disabled - docker not installed)
SEMVER := "0.0.0"
endif
endif
RELEASE_TAG := $(or $(RELEASE_TAG),latest)
PROTOS := ./api/proto
PROTOS_DISPERSER := ./disperser/api/proto
PROTO_GEN := ./api/grpc
PROTO_GEN_DISPERSER_PATH = ./disperser/api/grpc
compile-el:
cd contracts && ./compile.sh compile-el
compile-dl:
cd contracts && ./compile.sh compile-dl
clean:
find $(PROTO_GEN) -name "*.pb.go" -type f | xargs rm -rf
mkdir -p $(PROTO_GEN)
find $(PROTO_GEN_DISPERSER_PATH) -name "*.pb.go" -type f | xargs rm -rf
mkdir -p $(PROTO_GEN_DISPERSER_PATH)
protoc: clean
protoc -I $(PROTOS) \
--go_out=$(PROTO_GEN) \
--go_opt=paths=source_relative \
--go-grpc_out=$(PROTO_GEN) \
--go-grpc_opt=paths=source_relative \
$(PROTOS)/**/*.proto
# Generate Protobuf for sub directories of ./api/proto/disperser
protoc -I $(PROTOS_DISPERSER) -I $(PROTOS) \
--go_out=$(PROTO_GEN_DISPERSER_PATH) \
--go_opt=paths=source_relative \
--go-grpc_out=$(PROTO_GEN_DISPERSER_PATH) \
--go-grpc_opt=paths=source_relative \
$(PROTOS_DISPERSER)/**/*.proto
lint:
golint -set_exit_status ./...
go tool fix ./..
golangci-lint run
build:
cd operators/churner && make build
cd disperser && make build
cd node && make build
cd retriever && make build
cd tools/traffic && make build
cd tools/kzgpad && make build
dataapi-build:
cd disperser && go build -o ./bin/dataapi ./cmd/dataapi
unit-tests:
./test.sh
integration-tests-churner:
go test -v ./churner/tests
integration-tests-indexer:
go test -v ./core/indexer
integration-tests-node-plugin:
go test -v ./node/plugin/tests
integration-tests-inabox:
make build
cd inabox && make run-e2e
integration-tests-inabox-nochurner:
make build
cd inabox && make run-e2e-nochurner
integration-tests-graph-indexer:
make build
go test -v ./core/thegraph
integration-tests-dataapi:
make dataapi-build
go test -v ./disperser/dataapi
docker-release-build:
RELEASE_TAG=${SEMVER} docker compose -f docker-compose-release.yaml build --build-arg SEMVER=${SEMVER} --build-arg GITCOMMIT=${GITCOMMIT} --build-arg GITDATE=${GITDATE} ${PUSH_FLAG}
semver:
echo "${SEMVER}"