Skip to content

Commit

Permalink
go/simapp: fix module path
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele committed Sep 21, 2022
1 parent b6313af commit 2a5b4c1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
31 changes: 22 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,21 @@ Signed_RustEnclave_Name := bin/enclave.signed.so

######## Test Settings ########

DOCKER ?= docker
DOCKER_BUILD ?= $(DOCKER) build --rm --no-cache --pull
GAIAD_VERSION ?= v7.0.3

######## Targets ########

.PHONY: all
all: $(App_Path) $(Signed_RustEnclave_Name)

.PHONY: clean
clean:
@rm -f $(App_Dir)/* $(RustEnclave_Name) $(Signed_RustEnclave_Name) enclave/*_t.* app/*_u.* lib/*.a
@cd enclave && cargo clean && rm -f Cargo.lock
@cargo clean && rm -f Cargo.lock

######## EDL Objects ########

$(Enclave_EDL_Files): $(SGX_EDGER8R) enclave/Enclave.edl
Expand Down Expand Up @@ -166,12 +176,6 @@ enclave:
@cd enclave && RUSTFLAGS=$(RUSTFLAGS) cargo build $(CARGO_TARGET) $(CARGO_FEATURES)
@cp enclave/target/$(OUTPUT_PATH)/libproxy_enclave.a ./lib/libenclave.a

.PHONY: clean
clean:
@rm -f $(App_Dir)/* $(RustEnclave_Name) $(Signed_RustEnclave_Name) enclave/*_t.* app/*_u.* lib/*.a
@cd enclave && cargo clean && rm -f Cargo.lock
@cargo clean && rm -f Cargo.lock

.PHONY: fmt
fmt:
@cargo fmt --all && cd ./enclave && cargo fmt --all
Expand All @@ -180,9 +184,9 @@ fmt:
proto:
@cd proto-compiler && cargo run -- compile --ibc /tmp/cosmos/ibc --out ../proto/src/prost --descriptor ../proto/src/descriptor.bin

.PHONY: docker
docker:
@cd rust-sgx-sdk/dockerfile && docker build --no-cache -t datachainlab/sgx-rust:2004-1.1.5 -f Dockerfile.2004.nightly .
.PHONY: yrly
yrly:
go build -o ./bin/yrly ./go/relay/bin

.PHONY: test
test:
Expand All @@ -198,3 +202,12 @@ test-setup-nodes: bin/gaiad

bin/gaiad:
curl -o ./bin/gaiad -LO https://github.com/cosmos/gaia/releases/download/$(GAIAD_VERSION)/gaiad-$(GAIAD_VERSION)-linux-amd64 && chmod +x ./bin/gaiad

.PHONY: docker
sgx-docker:
@cd rust-sgx-sdk/dockerfile && docker build --no-cache -t datachainlab/sgx-rust:2004-1.1.5 -f Dockerfile.2004.nightly .

.PHONY: tendermint-docker
tendermint-docker:
$(DOCKER_BUILD) --build-arg CHAINID=ibc0 --tag tendermint-chain0 -f ./go/simapp/Dockerfile .
$(DOCKER_BUILD) --build-arg CHAINID=ibc1 --tag tendermint-chain1 -f ./go/simapp/Dockerfile .
11 changes: 0 additions & 11 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
LCP_REPO ?= ..
DOCKER ?= docker
DOCKER_BUILD ?= $(DOCKER) build --rm --no-cache --pull

.PHONY: yrly
yrly:
go build -o ./build/yrly ./relay/bin/main.go

.PHONY: proto-gen
proto-gen:
@echo "Generating Protobuf files"
@rm -rf ./proto/ibc && rm -rf ./proto/lcp && cp -a $(LCP_REPO)/proto/definitions/ibc ./proto/ && cp -a $(LCP_REPO)/proto/definitions/lcp ./proto/
docker run -v $(CURDIR):/workspace --workdir /workspace tendermintdev/sdk-proto-gen:v0.3 sh ./scripts/protocgen.sh

.PHONY: tendermint-docker
tendermint-docker:
$(DOCKER_BUILD) --build-arg CHAINID=ibc0 --tag tendermint-chain0 -f ./simapp/Dockerfile .
$(DOCKER_BUILD) --build-arg CHAINID=ibc1 --tag tendermint-chain1 -f ./simapp/Dockerfile .
4 changes: 2 additions & 2 deletions go/simapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.18.6-bullseye

COPY . /root/
WORKDIR /root/simapp
WORKDIR /root/go/simapp

RUN go build -mod readonly -o /usr/bin/simd ./simd
RUN apt-get update -y && apt-get install -y jq

WORKDIR /root/simapp
WORKDIR /root/go/simapp

ARG CHAINID
ARG CHAINDIR=/root/data
Expand Down
4 changes: 2 additions & 2 deletions go/simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/cosmos/cosmos-sdk v0.45.7
github.com/cosmos/ibc-go/v4 v4.0.0
github.com/datachainlab/lcp/go v0.0.0
github.com/datachainlab/lcp v0.0.0
github.com/gorilla/mux v1.8.0
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.0
Expand Down Expand Up @@ -128,4 +128,4 @@ require (

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

replace github.com/datachainlab/lcp/go => ../
replace github.com/datachainlab/lcp => ../../
2 changes: 1 addition & 1 deletion tests/e2e/cases/tm2tm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DOCKER_REPO ?= ""
DOCKER_TAG ?= latest
DOCKER_BUILD ?= $(DOCKER) build --rm --no-cache --pull

RLY_BIN ?= ../../../../go/build/yrly
RLY_BIN ?= ../../../../bin/yrly

.PHONY: network
network:
Expand Down

0 comments on commit 2a5b4c1

Please sign in to comment.