forked from cerc-io/laconicd-deprecated
conflicts
This commit is contained in:
@@ -19,8 +19,9 @@ COMMIT := $(shell git log -1 --format='%H')
|
||||
PACKAGES=$(shell go list ./... | grep -Ev 'vendor|importer|rpc/tester')
|
||||
DOCKER_TAG = unstable
|
||||
DOCKER_IMAGE = cosmos/ethermint
|
||||
ETHERMINT_DAEMON_BINARY = ethermintd
|
||||
ETHERMINT_CLI_BINARY = ethermintcli
|
||||
DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf
|
||||
ETHERMINT_BINARY = ethermintd
|
||||
ETHERMINT_DIR = ethermint
|
||||
GO_MOD=GO111MODULE=on
|
||||
BUILDDIR ?= $(CURDIR)/build
|
||||
SIMAPP = ./app
|
||||
@@ -34,7 +35,7 @@ ifeq ($(OS),Windows_NT)
|
||||
DETECTED_OS := windows
|
||||
else
|
||||
UNAME_S = $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
DETECTED_OS := mac
|
||||
else
|
||||
DETECTED_OS := linux
|
||||
@@ -106,8 +107,7 @@ build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))
|
||||
# process linker flags
|
||||
|
||||
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=ethermint \
|
||||
-X github.com/cosmos/cosmos-sdk/version.ServerName=$(ETHERMINT_DAEMON_BINARY) \
|
||||
-X github.com/cosmos/cosmos-sdk/version.ClientName=$(ETHERMINT_CLI_BINARY) \
|
||||
-X github.com/cosmos/cosmos-sdk/version.AppName=$(ETHERMINT_BINARY) \
|
||||
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
|
||||
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
|
||||
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
|
||||
@@ -129,17 +129,14 @@ all: tools verify install
|
||||
build: go.sum
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
go build -mod=readonly $(BUILD_FLAGS) -o build/$(ETHERMINT_DAEMON_BINARY).exe ./cmd/$(ETHERMINT_DAEMON_BINARY)
|
||||
go build -mod=readonly $(BUILD_FLAGS) -o build/$(ETHERMINT_CLI_BINARY).exe ./cmd/$(ETHERMINT_CLI_BINARY)
|
||||
go build $(BUILD_FLAGS) -o build/$(ETHERMINT_BINARY).exe ./cmd/$(ETHERMINT_BINARY)
|
||||
else
|
||||
go build -mod=readonly $(BUILD_FLAGS) -o build/$(ETHERMINT_DAEMON_BINARY) ./cmd/$(ETHERMINT_DAEMON_BINARY)
|
||||
go build -mod=readonly $(BUILD_FLAGS) -o build/$(ETHERMINT_CLI_BINARY) ./cmd/$(ETHERMINT_CLI_BINARY)
|
||||
go build $(BUILD_FLAGS) -o build/$(ETHERMINT_BINARY) ./cmd/$(ETHERMINT_BINARY)
|
||||
endif
|
||||
|
||||
build-ethermint: go.sum
|
||||
mkdir -p $(BUILDDIR)
|
||||
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR) ./cmd/$(ETHERMINT_DAEMON_BINARY)
|
||||
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR) ./cmd/$(ETHERMINT_CLI_BINARY)
|
||||
go build $(BUILD_FLAGS) -o $(BUILDDIR) ./cmd/$(ETHERMINT_BINARY)
|
||||
|
||||
build-ethermint-linux: go.sum
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 $(MAKE) build-ethermint
|
||||
@@ -147,8 +144,7 @@ build-ethermint-linux: go.sum
|
||||
.PHONY: build build-ethermint build-ethermint-linux
|
||||
|
||||
install:
|
||||
${GO_MOD} go install $(BUILD_FLAGS) ./cmd/$(ETHERMINT_DAEMON_BINARY)
|
||||
${GO_MOD} go install $(BUILD_FLAGS) ./cmd/$(ETHERMINT_CLI_BINARY)
|
||||
${GO_MOD} go install $(BUILD_FLAGS) ./cmd/$(ETHERMINT_BINARY)
|
||||
|
||||
clean:
|
||||
@rm -rf ./build ./vendor
|
||||
@@ -165,8 +161,7 @@ docker-build:
|
||||
docker create --name ethermint -t -i cosmos/ethermint:latest ethermint
|
||||
# move the binaries to the ./build directory
|
||||
mkdir -p ./build/
|
||||
docker cp ethermint:/usr/bin/ethermintd ./build/ ; \
|
||||
docker cp ethermint:/usr/bin/ethermintcli ./build/
|
||||
docker cp ethermint:/usr/bin/ethermintd ./build/
|
||||
|
||||
docker-localnet:
|
||||
docker build -f ./networks/local/ethermintnode/Dockerfile . -t ethermintd/node
|
||||
@@ -186,40 +181,47 @@ RUNSIM = $(TOOLS_DESTDIR)/runsim
|
||||
runsim: $(RUNSIM)
|
||||
$(RUNSIM):
|
||||
@echo "Installing runsim..."
|
||||
@(cd /tmp && ${GO_MOD} go get github.com/cosmos/tools/cmd/runsim@v1.0.0)
|
||||
@(cd /tmp && ${GO_MOD} go get github.com/cosmos/tools/cmd/runsim@master)
|
||||
|
||||
contract-tools:
|
||||
ifeq (, $(shell which stringer))
|
||||
@echo "Installing stringer..."
|
||||
@go install golang.org/x/tools/cmd/stringer
|
||||
@go get golang.org/x/tools/cmd/stringer
|
||||
else
|
||||
@echo "stringer already installed; skipping..."
|
||||
endif
|
||||
|
||||
ifeq (, $(shell which go-bindata))
|
||||
@echo "Installing go-bindata..."
|
||||
@go install github.com/kevinburke/go-bindata/go-bindata
|
||||
@go get github.com/kevinburke/go-bindata/go-bindata
|
||||
else
|
||||
@echo "go-bindata already installed; skipping..."
|
||||
endif
|
||||
|
||||
ifeq (, $(shell which gencodec))
|
||||
@echo "Installing gencodec..."
|
||||
@go install github.com/fjl/gencodec
|
||||
@go get github.com/fjl/gencodec
|
||||
else
|
||||
@echo "gencodec already installed; skipping..."
|
||||
endif
|
||||
|
||||
ifeq (, $(shell which protoc-gen-go))
|
||||
@echo "Installing protoc-gen-go..."
|
||||
@go install github.com/golang/protobuf/protoc-gen-go
|
||||
@go get github.com/fjl/gencodec github.com/golang/protobuf/protoc-gen-go
|
||||
else
|
||||
@echo "protoc-gen-go already installed; skipping..."
|
||||
endif
|
||||
|
||||
ifeq (, $(shell which protoc))
|
||||
@echo "Please istalling protobuf according to your OS"
|
||||
@echo "macOS: brew install protobuf"
|
||||
@echo "linux: apt-get install -f -y protobuf-compiler"
|
||||
else
|
||||
@echo "protoc already installed; skipping..."
|
||||
endif
|
||||
|
||||
ifeq (, $(shell which solcjs))
|
||||
@echo "Installing solcjs..."
|
||||
@apt-get install -f -y protobuf-compiler
|
||||
@npm install -g solc@0.5.11
|
||||
else
|
||||
@echo "solcjs already installed; skipping..."
|
||||
@@ -234,7 +236,7 @@ else
|
||||
endif
|
||||
|
||||
tools: tools-stamp
|
||||
tools-stamp: contract-tools docs-tools runsim
|
||||
tools-stamp: contract-tools docs-tools proto-tools runsim
|
||||
# Create dummy file to satisfy dependency and avoid
|
||||
# rebuilding when this Makefile target is hit twice
|
||||
# in a row.
|
||||
@@ -250,7 +252,7 @@ docs-tools-stamp: docs-tools
|
||||
# in a row.
|
||||
touch $@
|
||||
|
||||
.PHONY: runsim tools tools-stamp tools-clean docs-tools-stamp
|
||||
.PHONY: runsim tools contract-tools docs-tools proto-tools tools-stamp tools-clean docs-tools-stamp
|
||||
|
||||
###############################################################################
|
||||
### Tests & Simulation ###
|
||||
@@ -270,10 +272,10 @@ test-import:
|
||||
rm -rf importer/tmp
|
||||
|
||||
test-rpc:
|
||||
./scripts/integration-test-all.sh -t "rpc" -q 1 -z 1 -s 2 -m "rpc"
|
||||
./scripts/integration-test-all.sh -t "rpc" -q 1 -z 1 -s 2 -m "rpc" -r "true"
|
||||
|
||||
test-rpc-pending:
|
||||
./scripts/integration-test-all.sh -t "pending" -q 1 -z 1 -s 2 -m "pending"
|
||||
./scripts/integration-test-all.sh -t "pending" -q 1 -z 1 -s 2 -m "pending" -r "true"
|
||||
|
||||
test-contract:
|
||||
@type "npm" 2> /dev/null || (echo 'Npm does not exist. Please install node.js and npm."' && exit 1)
|
||||
@@ -288,22 +290,22 @@ test-sim-nondeterminism:
|
||||
|
||||
test-sim-custom-genesis-fast:
|
||||
@echo "Running custom genesis simulation..."
|
||||
@echo "By default, ${HOME}/.$(ETHERMINT_DAEMON_BINARY)/config/genesis.json will be used."
|
||||
@go test -mod=readonly $(SIMAPP) -run TestFullAppSimulation -Genesis=${HOME}/.$(ETHERMINT_DAEMON_BINARY)/config/genesis.json \
|
||||
@echo "By default, ${HOME}/.$(ETHERMINT_DIR)/config/genesis.json will be used."
|
||||
@go test -mod=readonly $(SIMAPP) -run TestFullAppSimulation -Genesis=${HOME}/.$(ETHERMINT_DIR)/config/genesis.json \
|
||||
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h
|
||||
|
||||
test-sim-import-export: runsim
|
||||
@echo "Running application import/export simulation. This may take several minutes..."
|
||||
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppImportExport
|
||||
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail -Genesis=${HOME}/.$(ETHERMINT_DIR)/config/genesis.json 50 5 TestAppImportExport
|
||||
|
||||
test-sim-after-import: runsim
|
||||
@echo "Running application simulation-after-import. This may take several minutes..."
|
||||
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppSimulationAfterImport
|
||||
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -Genesis=${HOME}/.$(ETHERMINT_DIR)/config/genesis.json -ExitOnFail 50 5 TestAppSimulationAfterImport
|
||||
|
||||
test-sim-custom-genesis-multi-seed: runsim
|
||||
@echo "Running multi-seed custom genesis simulation..."
|
||||
@echo "By default, ${HOME}/.$(ETHERMINT_DAEMON_BINARY)/config/genesis.json will be used."
|
||||
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail -Genesis=${HOME}/.$(ETHERMINT_DAEMON_BINARY)/config/genesis.json 400 5 TestFullAppSimulation
|
||||
@echo "By default, ${HOME}/.$(ETHERMINT_DIR)/config/genesis.json will be used."
|
||||
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail -Genesis=${HOME}/.$(ETHERMINT_DIR)/config/genesis.json 400 5 TestFullAppSimulation
|
||||
|
||||
test-sim-multi-seed-long: runsim
|
||||
@echo "Running multi-seed application simulation. This may take awhile!"
|
||||
@@ -359,13 +361,19 @@ proto-format:
|
||||
proto-swagger-gen:
|
||||
@./scripts/protoc-swagger-gen.sh
|
||||
|
||||
proto-format:
|
||||
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;
|
||||
|
||||
proto-swagger-gen:
|
||||
@./scripts/protoc-swagger-gen.sh
|
||||
|
||||
proto-lint:
|
||||
@$(DOCKER_BUF) check lint --error-format=json
|
||||
|
||||
proto-check-breaking:
|
||||
@$(DOCKER_BUF) check breaking --against-input $(HTTPS_GIT)#branch=development
|
||||
|
||||
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint
|
||||
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.1/proto/tendermint
|
||||
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
|
||||
COSMOS_SDK_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/master
|
||||
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
|
||||
@@ -437,13 +445,13 @@ ifeq ($(OS),Windows_NT)
|
||||
mkdir build &
|
||||
@$(MAKE) docker-localnet
|
||||
|
||||
IF not exist "build/node0/$(ETHERMINT_DAEMON_BINARY)/config/genesis.json" docker run --rm -v $(CURDIR)/build\ethermint\Z ethermintd/node "ethermintd testnet --v 4 -o /ethermint --starting-ip-address 192.168.10.2 --keyring-backend=test"
|
||||
IF not exist "build/node0/$(ETHERMINT_BINARY)/config/genesis.json" docker run --rm -v $(CURDIR)/build\ethermint\Z ethermintd/node "ethermintd testnet --v 4 -o /ethermint --starting-ip-address 192.168.10.2 --keyring-backend=test"
|
||||
docker-compose up -d
|
||||
else
|
||||
mkdir -p ./build/
|
||||
@$(MAKE) docker-localnet
|
||||
|
||||
if ! [ -f build/node0/$(ETHERMINT_DAEMON_BINARY)/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/ethermint:Z ethermintd/node "ethermintd testnet --v 4 -o /ethermint --starting-ip-address 192.168.10.2 --keyring-backend=test"; fi
|
||||
if ! [ -f build/node0/$(ETHERMINT_BINARY)/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/ethermint:Z ethermintd/node "ethermintd testnet --v 4 -o /ethermint --starting-ip-address 192.168.10.2 --keyring-backend=test"; fi
|
||||
docker-compose up -d
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user