From c0b6b85eaefcba419bf2ceda29f693777f3b6c44 Mon Sep 17 00:00:00 2001 From: MHXW Date: Wed, 19 Aug 2020 23:01:38 +0800 Subject: [PATCH] fix Makefile (#448) * fix makefile error caused by DETECTED_OS * add `clean testnet` and `reset testnet` Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> --- Makefile | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2250cf0a..39514bb4 100644 --- a/Makefile +++ b/Makefile @@ -28,18 +28,17 @@ SIMAPP = github.com/cosmos/ethermint/app RUNSIM = $(BINDIR)/runsim LEDGER_ENABLED ?= true -ifeq ($(DETECTED_OS),) - ifeq ($(OS),Windows_NT) - DETECTED_OS := windows +ifeq ($(OS),Windows_NT) + DETECTED_OS := windows +else + UNAME_S = $(shell uname -s) +ifeq ($(UNAME_S),Darwin) + DETECTED_OS := mac else - UNAME_S = $(shell uname -s) - ifeq ($(UNAME_S),Darwin) - DETECTED_OS := mac - else - DETECTED_OS := linux - endif + DETECTED_OS := linux endif endif +export DETECTED_OS export GO111MODULE = on # process build tags @@ -353,4 +352,24 @@ endif localnet-stop: docker-compose down +# clean testnet +localnet-clean: + docker-compose down + sudo rm -rf build/* + + # reset testnet +localnet-unsafe-reset: + docker-compose down +ifeq ($(OS),Windows_NT) + @docker run --rm -v $(CURDIR)/build\ethermint\Z ethermintd/node "ethermintd unsafe-reset-all --home=/ethermint/node0/ethermintd" + @docker run --rm -v $(CURDIR)/build\ethermint\Z ethermintd/node "ethermintd unsafe-reset-all --home=/ethermint/node1/ethermintd" + @docker run --rm -v $(CURDIR)/build\ethermint\Z ethermintd/node "ethermintd unsafe-reset-all --home=/ethermint/node2/ethermintd" + @docker run --rm -v $(CURDIR)/build\ethermint\Z ethermintd/node "ethermintd unsafe-reset-all --home=/ethermint/node3/ethermintd" +else + @docker run --rm -v $(CURDIR)/build:/ethermint:Z ethermintd/node "ethermintd unsafe-reset-all --home=/ethermint/node0/ethermintd" + @docker run --rm -v $(CURDIR)/build:/ethermint:Z ethermintd/node "ethermintd unsafe-reset-all --home=/ethermint/node1/ethermintd" + @docker run --rm -v $(CURDIR)/build:/ethermint:Z ethermintd/node "ethermintd unsafe-reset-all --home=/ethermint/node2/ethermintd" + @docker run --rm -v $(CURDIR)/build:/ethermint:Z ethermintd/node "ethermintd unsafe-reset-all --home=/ethermint/node3/ethermintd" +endif + .PHONY: build-docker-local-ethermint localnet-start localnet-stop