1- VERSION := $(shell echo $(shell git describe --tags 2>/dev/null || git log -1 --format='% h') | sed 's/^v//')
2- COMMIT := $(shell git rev-parse --short HEAD)
3- DOCKER := $(shell which docker)
4- DOCKER_BUF := $(DOCKER ) run --rm -v $(CURDIR ) :/workspace --workdir /workspace bufbuild/buf
5- IMAGE := ghcr.io/tendermint/docker-build-proto:latest
6- DOCKER_PROTO_BUILDER := docker run -v $(shell pwd) :/workspace --workdir /workspace $(IMAGE )
71PROJECT_NAME =$(shell basename "$(PWD ) ")
8- HTTPS_GIT := https://github.com/celestiaorg/celestia-zkevm-ibc-demo
9- SIMAPP_GHCR_REPO := ghcr.io/celestiaorg/celestia-zkevm-ibc-demo/simapp
10- CELESTIA_PROVER_GHCR_REPO := ghcr.io/celestiaorg/celestia-zkevm-ibc-demo/celestia-prover
11- EVM_PROVER_GHCR_REPO := ghcr.io/celestiaorg/celestia-zkevm-ibc-demo/evm-prover
12- INDEXER_GHCR_REPO := ghcr.io/celestiaorg/celestia-zkevm-ibc-demo/indexer
13-
14- # process linker flags
15- ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=celestia-zkevm-ibc-demo \
16- -X github.com/cosmos/cosmos-sdk/version.AppName=celestia-zkevm-ibc-demo \
17- -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION ) \
18- -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT ) \
19-
20- BUILD_FLAGS := -tags "ledger" -ldflags '$(ldflags ) '
212
223# # help: Get more info on make commands.
234help : Makefile
245 @echo " Choose a command run in " $(PROJECT_NAME ) " :"
256 @sed -n ' s/^##//p' $< | sort | column -t -s ' :' | sed -e ' s/^/ /'
267.PHONY : help
278
28- # # install-dependencies: Install all dependencies needed for the demo.
29- install-dependencies :
30- @echo " --> Setting up Solidity IBC Eureka submodule"
31- @cd ./solidity-ibc-eureka && bun install && just install-operator
32- .PHONY : install-dependencies
33-
349# # check-dependencies: Check if all dependencies are installed.
3510check-dependencies :
3611 @echo " --> Checking if all dependencies are installed"
@@ -46,223 +21,50 @@ check-dependencies:
4621 echo " Error: forge is not installed. Please install Foundry." ; \
4722 exit 1; \
4823 fi
49- @if command -v bun > /dev/null 2>&1 ; then \
50- echo " bun is installed." ; \
51- else \
52- echo " Error: bun is not installed. Please install bun." ; \
53- exit 1; \
54- fi
55- @if command -v just > /dev/null 2>&1 ; then \
56- echo " just is installed." ; \
57- else \
58- echo " Error: just is not installed. Please install just." ; \
59- exit 1; \
60- fi
6124 @if command -v cargo prove > /dev/null 2>&1 ; then \
6225 echo " cargo prove is installed." ; \
6326 else \
6427 echo " Error: succinct is not installed. Please install SP1." ; \
6528 exit 1; \
6629 fi
67- @if command -v operator > /dev/null 2>&1 ; then \
68- echo " operator is installed." ; \
69- else \
70- echo " Error: operator is not installed. Please run install-dependencies." ; \
71- exit 1; \
72- fi
7330 @echo " All dependencies are installed."
7431.PHONY : check-dependencies
7532
76- # # demo: Run the entire demo.
77- demo :
78- @make start
79- @make setup
80- @make transfer
81- @make transfer-back
82- .PHONY : demo
83-
8433# # start: Start all Docker containers for the demo.
8534start :
35+ @echo " --> Starting all Docker containers"
8636 @docker compose up --detach
8737.PHONY : start
8838
89- # # relay-local: Start a local instance of the hyperlane relayer (NOTE: This is temporary and should be removed in favour of Docker).
90- relay-local :
91- @echo " --> Starting hyperlane relayer"
92- @cd local && CONFIG_FILES=./config/config.json ./relayer
93- .PHONY : relay-local
94-
95- # # setup: Set up the IBC light clients.
96- setup :
97- @echo " --> Creating genesis.json for Tendermint light client"
98- @cd ./solidity-ibc-eureka && cargo run --quiet --bin operator --release -- genesis -o scripts/genesis.json --proof-type groth16
99- @echo " --> Creating IBC light clients"
100- @go run ./testing/demo/pkg/setup/
101- .PHONY : setup
39+ # # stop: Stop all Docker containers and remove volumes.
40+ stop :
41+ @echo " --> Stopping all Docker containers"
42+ @docker compose down -v
43+ .PHONY : stop
10244
103- # # transfer: Transfer tokens from simapp to the EVM roll-up.
45+ # # transfer: Transfer tokens from celestia-app to the EVM roll-up.
10446transfer :
105- @echo " --> Transferring tokens from simapp to the EVM roll-up"
106- @go run ./testing/demo/pkg/transfer/ transfer
47+ @echo " --> Transferring tokens from celestia-app to the EVM roll-up"
48+ @docker run --rm \
49+ --network celestia-zkevm-hl-testnet_celestia-zkevm-net \
50+ --volume celestia-zkevm-hl-testnet_celestia-app :/home/celestia/.celestia-app \
51+ ghcr.io/celestiaorg/celestia-app-standalone :feature-zk-execution-ism \
52+ tx warp transfer 0x726f757465725f61707000000000000000000000000000010000000000000000 1234 0x000000000000000000000000d7958B336f0019081Ad2279B2B7B7c3f744Bce0a "1000" \
53+ --from default --fees 400utia --max-hyperlane-fee 100utia --node http ://celestia-validator:26657 --yes
10754.PHONY : transfer
10855
109- # # transfer-back: Transfer tokens back from the EVM roll-up to simapp.
56+ # # transfer-back: Transfer tokens back from the EVM roll-up to celestia-app.
57+ # TODO: https://github.com/celestiaorg/celestia-zkevm-hl-testnet/issues/34
11058transfer-back :
111- @echo " --> Transferring tokens back from the EVM roll-up to simapp "
59+ @echo " --> Transferring tokens back from the EVM roll-up to celestia-app "
11260 @go run ./testing/demo/pkg/transfer/ transfer-back
11361.PHONY : transfer-back
11462
11563# # query-balance: Query the balance of the receiver in the EVM roll-up.
11664query-balance :
117- @echo " --> Querying the balance of the receivier on the EVM roll-up"
118- @go run ./testing/demo/pkg/transfer/ query-balance
65+ @echo " --> Querying the balance of the receiver on the EVM roll-up"
66+ @cast call 0xa7578551baE89a96C3365b93493AD2D4EBcbAe97 \
67+ "balanceOf(address)(uint256)" \
68+ 0xd7958B336f0019081Ad2279B2B7B7c3f744Bce0a \
69+ --rpc-url http ://localhost:8545
11970.PHONY : query-balance
120-
121- # # stop: Stop all Docker containers and remove volumes.
122- stop :
123- @echo " --> Stopping all Docker containers"
124- @docker compose down -v
125- .PHONY : stop
126-
127- # # build: Build the simapp and indexer binaries into the ./build directory.
128- build : build-simapp build-indexer
129- .PHONY : build
130-
131- # # build-simapp: Build the simapp binary into the ./build directory.
132- build-simapp : mod
133- @cd ./simapp/simd/
134- @mkdir -p build/
135- @go build $(BUILD_FLAGS ) -o build/ ./simapp/simd/
136- .PHONY : build-simapp
137-
138- # # build-indexer: Build the indexer binary
139- build-indexer :
140- @cd ./indexer
141- @mkdir -p build/
142- @cd indexer && go build $(BUILD_FLAGS ) -o build/ .
143- .PHONY : build-indexer
144-
145- # # build-evm-prover: Build the EVM prover binary
146- build-evm-prover :
147- @cargo build --release --bin evm-prover
148- .PHONY : build-evm-prover
149-
150- # # install: Install the simapp binary into the $GOPATH/bin directory.
151- install : install-simapp
152- .PHONY : install
153-
154- # # install-simapp: Build and install the simapp binary into the $GOPATH/bin directory.
155- install-simapp :
156- @echo " --> Installing simd"
157- @go install $(BUILD_FLAGS ) ./simapp/simd/
158- .PHONY : install-simapp
159-
160- # # mod: Update all go.mod files.
161- mod :
162- @echo " --> Updating go.mod"
163- @go mod tidy
164- .PHONY : mod
165-
166- # # proto-gen: Generate protobuf files. Requires docker.
167- proto-gen :
168- @echo " --> Generating Protobuf files"
169- $(DOCKER_BUF ) generate
170- .PHONY : proto-gen
171-
172- # # proto-lint: Lint protobuf files. Requires docker.
173- proto-lint :
174- @echo " --> Linting Protobuf files"
175- @$(DOCKER_BUF ) lint --error-format=json
176- .PHONY : proto-lint
177-
178- # # proto-check-breaking: Check if there are any breaking change to protobuf definitions.
179- proto-check-breaking :
180- @echo " --> Checking if Protobuf definitions have any breaking changes"
181- @$(DOCKER_BUF ) breaking --against $(HTTPS_GIT ) # branch=main
182- .PHONY : proto-check-breaking
183-
184- # # proto-format: Format protobuf files. Requires Docker.
185- proto-format :
186- @echo " --> Formatting Protobuf files"
187- @$(DOCKER_PROTO_BUILDER ) find . -name ' *.proto' -path " ./proto/*" -exec clang-format -i {} \;
188- .PHONY : proto-format
189-
190- # # docker: Build the all Docker images.
191- docker : build-simapp-docker build-indexer-docker build-celestia-prover-docker build-evm-prover-docker
192- .PHONY : docker
193-
194- # # build-simapp-docker: Build the simapp docker image from the current branch. Requires docker.
195- build-simapp-docker : build-simapp
196- @echo " --> Building simapp Docker image"
197- $(DOCKER ) build -t $(SIMAPP_GHCR_REPO ) --file docker/simapp.Dockerfile .
198- .PHONY : build-simapp-docker
199-
200- # # build-indexer-docker: Build the indexer docker image. Requires docker.
201- build-indexer-docker : build-indexer
202- @echo " --> Building indexer Docker image"
203- $(DOCKER ) build -t $(INDEXER_GHCR_REPO ) --file docker/indexer.Dockerfile indexer
204- .PHONY : build-indexer-docker
205-
206- # # build-celestia-prover-docker: Build the celestia prover docker image from the current branch. Requires docker.
207- build-celestia-prover-docker :
208- @echo " --> Building celestia prover Docker image"
209- $(DOCKER ) build -t $(CELESTIA_PROVER_GHCR_REPO ) --file docker/celestia_prover.Dockerfile .
210- .PHONY : build-celestia-prover-docker
211-
212- # # build-evm-prover-docker: Build the EVM prover docker image from the current branch. Requires docker.
213- build-evm-prover-docker : build-evm-prover
214- @echo " --> Building EVM prover Docker image"
215- $(DOCKER ) build -t $(EVM_PROVER_GHCR_REPO ) --file docker/evm_prover.Dockerfile .
216- .PHONY : build-evm-prover-docker
217-
218- # publish: Publish all Docker images to GHCR. Requires Docker and authentication.
219- publish : publish-simapp-docker publish-celestia-prover-docker publish-evm-prover-docker
220- .PHONY : publish
221-
222- # # publish-simapp-docker: Publish the simapp docker image to GHCR. Requires Docker and authentication.
223- publish-simapp-docker :
224- $(DOCKER ) push $(SIMAPP_GHCR_REPO )
225- .PHONY : publish-simapp-docker
226-
227- # # publish-celestia-prover-docker: Publish the celestia prover docker image. Requires docker.
228- publish-celestia-prover-docker :
229- $(DOCKER ) push $(CELESTIA_PROVER_GHCR_REPO )
230- .PHONY : publish-celestia-prover-docker
231-
232- # # publish-evm-prover-docker: Publish the EVM prover docker image. Requires docker.
233- publish-evm-prover-docker :
234- $(DOCKER ) push $(EVM_PROVER_GHCR_REPO )
235- .PHONY : publish-evm-prover-docker
236-
237- # # lint: Run all linters; golangci-lint, markdownlint, hadolint, yamllint.
238- lint :
239- @echo " --> Running golangci-lint"
240- @golangci-lint run
241- @echo " --> Running markdownlint"
242- @markdownlint --config .markdownlint.yaml ' **/*.md'
243- @echo " --> Running hadolint"
244- @hadolint docker/**
245- @echo " --> Running yamllint"
246- @yamllint --no-warnings . -c .yamllint.yml
247- .PHONY : lint
248-
249- # # markdown-link-check: Check all markdown links.
250- markdown-link-check :
251- @echo " --> Running markdown-link-check"
252- # Skip the solidity-ibc-eureka directory because we don't want to fix their broken links.
253- @find . -name \*.md -not -path "./solidity-ibc-eureka/*" -print0 | xargs -0 -n1 markdown-link-check
254- .PHONY : markdown-link-check
255-
256- # # fmt: Format files per linters golangci-lint and markdownlint.
257- fmt :
258- @echo " --> Running golangci-lint --fix"
259- @golangci-lint run --fix
260- @echo " --> Running markdownlint --fix"
261- @markdownlint --fix --quiet --config .markdownlint.yaml .
262- .PHONY : fmt
263-
264- # # test: Run tests.
265- test :
266- @echo " --> Running tests"
267- @go test -timeout 30m ./...
268- .PHONY : test
0 commit comments