Skip to content

Commit

Permalink
Merge pull request #47 from rootulp/rp/fix-simd-exec
Browse files Browse the repository at this point in the history
fix(docker): building simapp docker image
  • Loading branch information
rootulp authored Dec 18, 2024
2 parents 1891477 + 7f769d3 commit d1edc78
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,32 @@ help: Makefile
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
.PHONY: help

## install-dependencies: Install all dependencies needed for the demo.
install-dependencies:
@echo "--> Setting up Solidity IBC Eureka submodule"
@cd ./solidity-ibc-eureka && bun install && just install-operator
@go run ./testing/demo/pkg/setup-env
.PHONY: install-dependencies

## start: spins up all processes needed for the demo
## start: Start all processes needed for the demo.
start: stop
@docker compose up -d
.PHONY: start

## setup: sets up the IBC clients and channels
## setup: Set up the IBC clients and channels.
setup:
@echo "--> Deploying tendermint light client contract on the EVM roll-up"
@cd ./solidity-ibc-eureka/scripts && just deploy-sp1-ics07
@echo "--> Setting up IBC Clients and Channels"
@go run ./testing/demo/pkg/setup/
.PHONY: setup

## transfer: transfers tokens from simapp network to the EVM rollup
## transfer: Transfer tokens from simapp network to the EVM rollup.
transfer:
@echo "--> Transferring tokens"
.PHONY: transfer

## stop: stops all processes and removes the tmp directory
## stop: Stop all processes and removes the tmp directory.
stop:
@echo "--> Stopping all processes"
@docker compose down
Expand All @@ -55,18 +56,18 @@ stop:
@rm -rf .tmp
.PHONY: stop

## build: Build the simapp binary into the ./build directory.
## build-simapp: Build the simapp binary into the ./build directory.
build-simapp: mod
@cd ./simapp/simd/
@mkdir -p build/
@go build $(BUILD_FLAGS) -o build/ ./simapp/simd/
.PHONY: build
.PHONY: build-simapp

## install: Build and install the simapp binary into the $GOPATH/bin directory.
## install-simapp: Build and install the simapp binary into the $GOPATH/bin directory.
install-simapp:
@echo "--> Installing simd"
@go install $(BUILD_FLAGS) ./simapp/simd/
.PHONY: install
.PHONY: install-simapp

## mod: Update all go.mod files.
mod:
Expand Down Expand Up @@ -148,9 +149,8 @@ test:
@go test -timeout 30m ./...
.PHONY: test

## run-simapp: Initializes a single local node network. It is useful for testing and development. Try make install && make init-simapp && simd start
## run-simapp: Initializes a single local node network. It is useful for testing and development.
run-simapp:
# Warning this will remove all data in simapp home directory
./scripts/init-simapp.sh
.PHONY: run-simapp

14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ZK-EVM X Celestia Token Transfer Demo

> ⚠️ **Warning**
> [!WARNING]
> This repository is a work in progress and under active development.
This repo exists to showcase transferring tokens to and from a Cosmos SDK chain (representing Celestia) and a ZK proveable EVM using the [IBC-Eureka solidity contracts](https://github.com/cosmos/solidity-ibc-eureka/blob/main/README.md). The diagram below is meant to detail the components involved and, at a high level, how they interact with one another.
Expand Down Expand Up @@ -30,7 +30,7 @@ For more information refer to the [architecture document](./ARCHITECTURE.md). No
git submodule update
```

1. Install contract dependencies and sp1 tendermint light client operator binary in solidity-ibc-eureka which is a requirement before deploying contracts
1. Install contract dependencies and the SP1 Tendermint light client operator binary from solidity-ibc-eureka.

```shell
make install-dependencies
Expand All @@ -42,17 +42,15 @@ For more information refer to the [architecture document](./ARCHITECTURE.md). No
make start
```

> [!TIP]: Double check that all 5 containers are started. Currently: the bridge might fail because it depends on the validator being available. If this happens, wait until the validator is available then start the bridge and beacond node again.

1. Set up IBC Clients and Channels:
1. Set up IBC clients and channels:

- Generate the `contracts/script/genesis.json` file which contains the initialization parameters for the `SP1ICS07Tendermint` light client contract.
- Initialize Groth16 light client on simapp.
- Create a channel on simapp.
- Deploy IBC contracts on the Reth node.
- Create a channel on the reth node.
- Create a counterparty on the reth node. (it will be pointing to groth16 client ID on simapp)
- Create a counterparty on the simapp. (it will be pointing to tendermint client ID on reth)
- Create a channel on the Reth node.
- Create a counterparty on the Reth node which points to the groth16 client ID on simapp.
- Create a counterparty on the simapp which points to the tendermint client ID on Reth.

```shell
make setup
Expand Down
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stage 1: generate txsim binary
# Stage 1: Generate the simapp binary (simd)
FROM --platform=$BUILDPLATFORM docker.io/golang:1.23.1-alpine3.20 as builder

ARG TARGETOS
Expand All @@ -19,9 +19,9 @@ WORKDIR /celestia_zkevm_ibc_demo

RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
make build
make build-simapp

# Stage 2: create a minimal image with the binary
# Stage 2: Create a minimal image with just the binary
FROM docker.io/alpine:3.20

# Use UID 10,001 because UIDs below 10,000 are a security risk.
Expand All @@ -45,7 +45,7 @@ RUN apk update && apk add --no-cache \
-s /sbin/nologin \
-u ${UID}

# Copy in the txsim binary
# Copy in the simd binary
COPY --from=builder /celestia_zkevm_ibc_demo/build/simd /bin/simd

USER ${USER_NAME}
Expand Down
2 changes: 1 addition & 1 deletion testing/files/simapp-validator/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Copy config files from testing/files/celestia-validator to .tmp directory
cp -r /testapp_files/* /home/celestia/

exec /bin/simd start --home /home/celestia
exec /bin/simd start --home /home/celestia

0 comments on commit d1edc78

Please sign in to comment.