forked from Layr-Labs/eigenda-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (77 loc) · 2.64 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
101
LINTER_VERSION = v1.52.1
LINTER_URL = https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh
GET_LINT_CMD = "curl -sSfL $(LINTER_URL) | sh -s -- -b $(go env GOPATH)/bin $(LINTER_VERSION)"
GIT_COMMIT ?= $(shell git rev-parse HEAD)
BUILD_TIME := $(shell date -u '+%Y-%m-%d--%H:%M:%S')
GIT_TAG := $(shell git describe --tags --always --dirty)
LDFLAGSSTRING +=-X main.Commit=$(GIT_COMMIT)
LDFLAGSSTRING +=-X main.Date=$(BUILD_TIME)
LDFLAGSSTRING +=-X main.Version=$(GIT_TAG)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
E2ETEST = INTEGRATION=true go test -timeout 1m ./e2e -parallel 4 -deploy-config ../.devnet/devnetL1.json
HOLESKYTEST = TESTNET=true go test -timeout 50m ./e2e -parallel 4 -deploy-config ../.devnet/devnetL1.json
.PHONY: eigenda-proxy
eigenda-proxy:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/eigenda-proxy ./cmd/server
.PHONY: docker-build
docker-build:
# we only use this to build the docker image locally, so we give it the dev tag as a reminder
@docker build -t ghcr.io/layr-labs/eigenda-proxy:dev .
run-minio:
docker run -p 4566:9000 -d -e "MINIO_ROOT_USER=minioadmin" -e "MINIO_ROOT_PASSWORD=minioadmin" --name minio minio/minio server /data
run-redis:
docker run -p 9001:6379 -d --name redis redis
stop-minio:
@if [ -n "$$(docker ps -q -f name=minio)" ]; then \
docker stop minio && docker rm minio; \
fi
stop-redis:
@if [ -n "$$(docker ps -q -f name=redis)" ]; then \
docker stop redis && docker rm redis; \
fi
run-memstore-server:
./bin/eigenda-proxy --memstore.enabled
disperse-test-blob:
curl -X POST -d my-blob-content http://127.0.0.1:3100/put/
clean:
rm bin/eigenda-proxy
test:
go test ./... -parallel 4
e2e-test: stop-minio stop-redis run-minio run-redis
$(E2ETEST) && \
make stop-minio && \
make stop-redis
holesky-test: stop-minio stop-redis run-minio run-redis
$(HOLESKYTEST) && \
make stop-minio && \
make stop-redis
.PHONY: lint
lint:
@if ! test -f &> /dev/null; \
then \
echo "golangci-lint command could not be found...."; \
echo "\nTo install, please run $(GET_LINT_CMD)"; \
echo "\nBuild instructions can be found at: https://golangci-lint.run/usage/install/."; \
exit 1; \
fi
@golangci-lint run
.PHONY: format
format:
@go fmt ./...
go-gen-mocks:
@echo "generating go mocks..."
@GO111MODULE=on go generate --run "mockgen*" ./...
install-lint:
@echo "Installing golangci-lint..."
@sh -c $(GET_LINT_CMD)
gosec:
@echo "Running security scan with gosec..."
gosec ./...
submodules:
git submodule update --init --recursive
op-devnet-allocs:
@echo "Generating devnet allocs..."
@./scripts/op-devnet-allocs.sh
.PHONY: \
clean \
test