From 63b66c1ffc706194e75f0a535011e8912e5483c6 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Tue, 26 Apr 2022 20:07:50 +0530 Subject: [PATCH] fix: fix the `make build` issue --- Makefile | 12 ++++++++++-- scripts/contract-test.sh | 2 +- scripts/integration-test-all.sh | 10 +++++----- scripts/start-docker.sh | 3 ++- scripts/start.sh | 14 +++++++------- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index d4870d31..4a1ee042 100755 --- a/Makefile +++ b/Makefile @@ -100,6 +100,12 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) BUILD_FLAGS += -trimpath endif +# Check for debug option +ifeq (debug,$(findstring debug,$(COSMOS_BUILD_OPTIONS))) + BUILD_FLAGS += -gcflags "all=-N -l" +endif + +all: tools build lint test # # The below include contains the tools and runsim targets. # include contrib/devtools/Makefile @@ -111,14 +117,16 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build + GOOS=linux GOARCH=$(if $(findstring aarch64,$(shell uname -m)) || $(findstring arm64,$(shell uname -m)),arm64,amd64) LEDGER_ENABLED=false $(MAKE) build $(BUILD_TARGETS): go.sum $(BUILDDIR)/ - go $@ $(BUILD_FLAGS) $(BUILD_ARGS) ./... + go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... $(BUILDDIR)/: mkdir -p $(BUILDDIR)/ +.PHONY: build build-linux cosmovisor + docker-build: # TODO replace with kaniko docker build -t ${DOCKER_IMAGE}:${DOCKER_TAG} . diff --git a/scripts/contract-test.sh b/scripts/contract-test.sh index 9b011bcf..6c9f0b33 100644 --- a/scripts/contract-test.sh +++ b/scripts/contract-test.sh @@ -35,7 +35,7 @@ cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["mint"]["params"]["m "$PWD"/build/chibaclonkd validate-genesis # Start the node (remove the --pruning=nothing flag if historical queries are not needed) in background and log to file -"$PWD"/build/chibaclonkd start --pruning=nothing --rpc.unsafe --json-rpc.address="0.0.0.0:8545" --keyring-backend test > ethermintd.log 2>&1 & +"$PWD"/build/chibaclonkd start --pruning=nothing --mode validator --rpc.unsafe --json-rpc.address="0.0.0.0:8545" --keyring-backend test > ethermintd.log 2>&1 & # Give ethermintd node enough time to launch sleep 5 diff --git a/scripts/integration-test-all.sh b/scripts/integration-test-all.sh index c13d84c4..11a0d00a 100755 --- a/scripts/integration-test-all.sh +++ b/scripts/integration-test-all.sh @@ -59,8 +59,8 @@ if [[ ! "$DATA_DIR" ]]; then exit 1 fi -# Compile ethermint -echo "compiling ethermint" +# Compile chibaclonk +echo "compiling chibaclonk" make build # PID array declaration @@ -103,16 +103,16 @@ init_func() { } start_func() { - echo "starting ethermint node $i in background ..." + echo "starting chibaclonk node $i in background ..." "$PWD"/build/chibaclonkd start --pruning=nothing --rpc.unsafe \ --p2p.laddr tcp://$IP_ADDR:$NODE_P2P_PORT"$i" --address tcp://$IP_ADDR:$NODE_PORT"$i" --rpc.laddr tcp://$IP_ADDR:$NODE_RPC_PORT"$i" \ --json-rpc.address=$IP_ADDR:$RPC_PORT"$i" \ --json-rpc.api="eth,txpool,personal,net,debug,web3" \ - --keyring-backend test --home "$DATA_DIR$i" \ + --keyring-backend test --mode validator --home "$DATA_DIR$i" \ >"$DATA_DIR"/node"$i".log 2>&1 & disown ETHERMINT_PID=$! - echo "started ethermint node, pid=$ETHERMINT_PID" + echo "started chibaclonk node, pid=$ETHERMINT_PID" # add PID to array arr+=("$ETHERMINT_PID") diff --git a/scripts/start-docker.sh b/scripts/start-docker.sh index 8a91326d..61b98cd4 100755 --- a/scripts/start-docker.sh +++ b/scripts/start-docker.sh @@ -6,7 +6,8 @@ chibaclonkd validate-genesis --home /chibaclonk echo "starting chibaclonk node $ID in background ..." chibaclonkd start \ --home /chibaclonk \ ---keyring-backend test +--keyring-backend test \ +--mode validator echo "started ethermint node" tail -f /dev/null \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh index 0a332c8e..92b9923d 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -61,8 +61,8 @@ if [[ ! "$DATA_CLI_DIR" ]]; then exit 1 fi -# Compile ethermint -echo "compiling ethermint" +# Compile chibaclonk +echo "compiling chibaclonk" make build # PID array declaration @@ -89,15 +89,15 @@ init_func() { } start_func() { - echo "starting ethermint node $i in background ..." + echo "starting chibaclonk node $i in background ..." "$PWD"/build/chibaclonkd start --pruning=nothing --rpc.unsafe \ --p2p.laddr tcp://$IP_ADDR:$NODE_P2P_PORT"$i" --address tcp://$IP_ADDR:$NODE_PORT"$i" --rpc.laddr tcp://$IP_ADDR:$NODE_RPC_PORT"$i" \ --json-rpc.address=$IP_ADDR:$RPC_PORT"$i" \ - --keyring-backend test --home "$DATA_DIR$i" \ + --keyring-backend test --mode validator --home "$DATA_DIR$i" \ >"$DATA_DIR"/node"$i".log 2>&1 & disown ETHERMINT_PID=$! - echo "started ethermint node, pid=$ETHERMINT_PID" + echo "started chibaclonk node, pid=$ETHERMINT_PID" # add PID to array arr+=("$ETHERMINT_PID") } @@ -123,7 +123,7 @@ if [[ -z $TEST || $TEST == "rpc" ]]; then for i in $(seq 1 "$TEST_QTD"); do HOST_RPC=http://$IP_ADDR:$RPC_PORT"$i" - echo "going to test ethermint node $HOST_RPC ..." + echo "going to test chibaclonk node $HOST_RPC ..." MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=300s -v -short MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=300s -v -short @@ -136,7 +136,7 @@ stop_func() { ETHERMINT_PID=$i echo "shutting down node, pid=$ETHERMINT_PID ..." - # Shutdown ethermint node + # Shutdown chibaclonk node kill -9 "$ETHERMINT_PID" wait "$ETHERMINT_PID" }