-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
147 lines (120 loc) · 4.95 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
VERSION := $(shell echo $(shell git describe --tags 2>/dev/null || git log -1 --format='%h') | sed 's/^v//')
COMMIT := $(shell git rev-parse --short HEAD)
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
IMAGE := ghcr.io/tendermint/docker-build-proto:latest
DOCKER_PROTO_BUILDER := docker run -v $(shell pwd):/workspace --workdir /workspace $(IMAGE)
PROJECTNAME=$(shell basename "$(PWD)")
HTTPS_GIT := https://github.com/celestiaorg/celestia-zkevm-ibc-demo
PACKAGE_NAME := github.com/regen-network/protobuf v1.3.2-alpha.regen.1
# Before upgrading the GOLANG_CROSS_VERSION, please verify that a Docker image exists with the new tag.
# See https://github.com/goreleaser/goreleaser-cross/pkgs/container/goreleaser-cross
GOLANG_CROSS_VERSION ?= v1.23.1
GHCR_REPO := ghcr.io/celestiaorg/simapp
# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=celestia-zkevm-ibc-demo \
-X github.com/cosmos/cosmos-sdk/version.AppName=celestia-zkevm-ibc-demo \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
BUILD_FLAGS := -tags "ledger" -ldflags '$(ldflags)'
## help: Get more info on make commands.
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
.PHONY: help
## build: Build the celestia-appd binary into the ./build directory.
build: mod
@cd ./simapp/simd/
@mkdir -p build/
@go build $(BUILD_FLAGS) -o build/ ./simapp/simd/
.PHONY: build
## install: Build and install the celestia-appd binary into the $GOPATH/bin directory.
install:
@echo "--> Installing simd"
@go install $(BUILD_FLAGS) ./simapp/simd/
.PHONY: install
## mod: Update all go.mod files.
mod:
@echo "--> Updating go.mod"
@go mod tidy
.PHONY: mod
## mod-verify: Verify dependencies have expected content.
mod-verify: mod
@echo "--> Verifying dependencies have expected content"
GO111MODULE=on go mod verify
.PHONY: mod-verify
## proto-gen: Generate protobuf files. Requires docker.
proto-gen:
@echo "--> Generating Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace tendermintdev/sdk-proto-gen:v0.7 sh ./scripts/protocgen.sh
.PHONY: proto-gen
## proto-lint: Lint protobuf files. Requires docker.
proto-lint:
@echo "--> Linting Protobuf files"
@$(DOCKER_BUF) lint --error-format=json
.PHONY: proto-lint
## proto-check-breaking: Check if there are any breaking change to protobuf definitions.
proto-check-breaking:
@echo "--> Checking if Protobuf definitions have any breaking changes"
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main
.PHONY: proto-check-breaking
## proto-format: Format protobuf files. Requires Docker.
proto-format:
@echo "--> Formatting Protobuf files"
@$(DOCKER_PROTO_BUILDER) find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \;
.PHONY: proto-format
## build-docker: Build the celestia-appd docker image from the current branch. Requires docker.
build-docker:
@echo "--> Building Docker image"
$(DOCKER) build -t $(GHCR_REPO) -f docker/Dockerfile .
.PHONY: build-docker
## publish-docker: Publish the celestia-appd docker image to the docker hub. Requires docker and authentication.
publish-docker:
$(DOCKER) push $(GHCR_REPO)
.PHONY: publish-docker
## lint: Run all linters; golangci-lint, markdownlint, hadolint, yamllint.
lint:
@echo "--> Running golangci-lint"
@golangci-lint run
@echo "--> Running markdownlint"
@markdownlint --config .markdownlint.yaml '**/*.md'
@echo "--> Running hadolint"
@hadolint docker/Dockerfile
@hadolint docker/txsim/Dockerfile
@echo "--> Running yamllint"
@yamllint --no-warnings . -c .yamllint.yml
.PHONY: lint
## markdown-link-check: Check all markdown links.
markdown-link-check:
@echo "--> Running markdown-link-check"
@find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check
.PHONY: markdown-link-check
## fmt: Format files per linters golangci-lint and markdownlint.
fmt:
@echo "--> Running golangci-lint --fix"
@golangci-lint run --fix
@echo "--> Running markdownlint --fix"
@markdownlint --fix --quiet --config .markdownlint.yaml .
.PHONY: fmt
## test: Run tests.
test:
@echo "--> Running tests"
@go test -timeout 30m ./...
.PHONY: test
# make init-simapp initializes a single local node network
# it is useful for testing and development
# Usage: make install && make init-simapp && simd start
# Warning: make init-simapp will remove all data in simapp home directory
#? init-simapp: Run scripts/init-simapp.sh
init-simapp:
./scripts/init-simapp.sh
build-demo:
go build -o ./build/demo ./testing/demo
.PHONY: build-demo
run-demo:
go run ./testing/demo/main.go
.PHONY: run-demo
## deploy the IBC smart contracts
deploy-contracts:
forge script ./solidity-ibc-eureka/scripts/E2ETestDeploy.s.sol:E2ETestDeploy --rpc-url http://localhost:8545 --private-key 0x82bfcfadbf1712f6550d8d2c00a39f05b33ec78939d0167be2a737d691f33a6a --broadcast
.PHONY: deploy-contracts