forked from rollkit/omni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
123 lines (97 loc) · 5.36 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
help: ## Display this help message
@egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-30s\033[0m %s\n", $$1, $$2}'
###############################################################################
### Docker ###
###############################################################################
.PHONY: build-docker
build-docker: ensure-go-releaser build-explorer-ui ## Builds the docker images.
@goreleaser release --snapshot --clean
.PHONY: build-halo-relayer
build-halo-relayer: ensure-go-releaser ## Builds the halo and relayer docker images only (slightly faster than above).
@scripts/build_docker.sh halo
@scripts/build_docker.sh relayer
@scripts/build_docker.sh monitor
@scripts/build_docker.sh anvilproxy 'e2e' '' 'amd64'
.PHONY: ## Builds the explorer-ui docker image.
build-explorer-ui:
@make -C ./explorer build-ui
###############################################################################
### Contracts ###
###############################################################################
.PHONY: contracts-gen
contract-bindings: ## Generate golang contract bindings.
make -C ./contracts bindings
###############################################################################
### Explorer ###
###############################################################################
.PHONY: explorer-gen
explorer-gen: ## Generates code for our explorer
make -C ./explorer gen-db
make -C ./explorer gen-api
###############################################################################
### Utils ###
###############################################################################
.PHONY: install-cli
install-cli: ## Install the omni cli to $GOPATH/bin/omni.
@go install github.com/omni-network/omni/cli/cmd/omni || echo "❌go install failed"
@which omni || echo '❌ `which omni` failed, fix go environment: "export PATH=$$PATH:$$(go env GOPATH)/bin" # Or see https://go.dev/doc/gopath_code'
.PHONY: ensure-go-releaser
ensure-go-releaser: ## Installs the go-releaser tool.
@which goreleaser > /dev/null || echo "go-releaser not installed, see https://goreleaser.com/install/"
.PHONY: ensure-detect-secrets
ensure-detect-secrets: ## Checks if detect-secrets is installed.
@which detect-secrets > /dev/null || echo "detect-secrets not installed, see https://github.com/Yelp/detect-secrets?tab=readme-ov-file#installation"
.PHONY: install-pre-commit
install-pre-commit: ## Installs the pre-commit tool as the git pre-commit hook for this repo.
@which pre-commit > /dev/null || echo "pre-commit not installed, see https://pre-commit.com/#install"
@pre-commit install --install-hooks
.PHONY: install-go-tools
install-go-tools: ## Installs the go-dev-tools, like buf.
@go generate scripts/tools.go
.PHONY: lint
lint: ## Runs linters via pre-commit.
@pre-commit run -v --all-files
.PHONY: bufgen
bufgen: ## Generates protobufs using buf generate.
@./scripts/buf_generate.sh
.PHONY:
secrets-baseline: ensure-detect-secrets ## Update secrets baseline.
@detect-secrets scan --exclude-file pnpm-lock.yaml > .secrets.baseline
.PHONY: fix-golden
fix-golden: ## Fixes golden test fixtures.
@./scripts/fix_golden_tests.sh
###############################################################################
### Testing ###
###############################################################################
.PHONY: halo-simnet
halo-simnet: ## Runs halo in simnet mode.
@go install github.com/omni-network/omni/halo
@halo init --home=/tmp/halo --network=simnet --clean
@halo run --home=/tmp/halo
.PHONY: devnet-deploy
devnet-deploy: ## Deploys devnet1
@echo "Creating a docker-compose devnet in ./e2e/run/devnet1"
@go run github.com/omni-network/omni/e2e -f e2e/manifests/devnet1.toml deploy
.PHONY: devnet-clean
devnet-clean: ## Deletes devnet1 containers
@echo "Stopping the devnet in ./e2e/run/devnet1"
@go run github.com/omni-network/omni/e2e -f e2e/manifests/devnet1.toml clean
.PHONY: e2e-ci
e2e-ci: ## Runs all e2e CI tests
@go install github.com/omni-network/omni/e2e
@cd e2e && ./run-multiple.sh manifests/devnet1.toml manifests/fuzzyhead.toml manifests/ci.toml
.PHONY: e2e-run
e2e-run: ## Run specific e2e manifest (MANIFEST=single, MANIFEST=devnet1, etc). Note container remain running after the test.
@if [ -z "$(MANIFEST)" ]; then echo "⚠️ Please specify a manifest: MANIFEST=devnet1 make e2e-run" && exit 1; fi
@echo "Using MANIFEST=$(MANIFEST)"
@go run github.com/omni-network/omni/e2e -f e2e/manifests/$(MANIFEST).toml
.PHONY: e2e-logs
e2e-logs: ## Print the docker logs of previously ran e2e manifest (devnet1, etc).
@if [ -z "$(MANIFEST)" ]; then echo "⚠️ Please specify a manifest: MANIFEST=devnet1 make e2e-logs" && exit 1; fi
@echo "Using MANIFEST=$(MANIFEST)"
@go run github.com/omni-network/omni/e2e -f e2e/manifests/$(MANIFEST).toml logs
.PHONY: e2e-clean
e2e-clean: ## Deletes all running containers from previously ran e2e.
@if [ -z "$(MANIFEST)" ]; then echo "⚠️ Please specify a manifest: MANIFEST=devnet1 make e2e-clean" && exit 1; fi
@echo "Using MANIFEST=$(MANIFEST)"
@go run github.com/omni-network/omni/e2e -f e2e/manifests/$(MANIFEST).toml clean