diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa257c614..26c47ac66 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,24 +108,7 @@ We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along For linting, checking breaking changes and generating proto stubs, we use [buf](https://buf.build/). If you would like to run linting and check if the changes you have made are breaking then you will need to have docker running locally. Then the linting cmd will be `make proto-lint` and the breaking changes check will be `make proto-check-breaking`. -There are two ways to generate your proto stubs. - -1. Use Docker, pull an image that will generate your proto stubs with no need to install anything. `make proto-gen-docker` -2. Run `make proto-gen` after installing `buf` and `gogoproto`, you can do this by running `make protobuf`. - -### Installation Instructions - -To install `protoc`, download an appropriate release () and then move the provided binaries into your PATH (follow instructions in README included with the download). - -To install `gogoproto`, do the following: - -```sh -go get github.com/gogo/protobuf/gogoproto -cd $GOPATH/pkg/mod/github.com/gogo/protobuf@v1.3.1 # or wherever go get installs things -make install -``` - -You should now be able to run `make proto-gen` from inside the root Tendermint directory to generate new files from proto files. +We use [Docker](https://www.docker.com/) to generate the protobuf stubs. To generate the stubs yourself, make sure docker is running then run `make proto-gen`. ### Visual Studio Code @@ -429,7 +412,7 @@ most probably (99.9%)*. [Jepsen](http://jepsen.io/) tests are used to verify the [linearizability](https://jepsen.io/consistency/models/linearizable) property of the Tendermint consensus. They are located in a separate repository --> https://github.com/tendermint/jepsen. Please refer to it's README for more +-> . Please refer to its README for more information. ### RPC Testing @@ -445,7 +428,7 @@ make build-linux build-contract-tests-hooks make contract-tests ``` -**WARNING: these are currently broken due to https://github.com/apiaryio/dredd +**WARNING: these are currently broken due to not supporting complete OpenAPI 3**. This command will popup a network and check every endpoint against what has diff --git a/Makefile b/Makefile index 73bc0923d..66d11dd6a 100644 --- a/Makefile +++ b/Makefile @@ -58,8 +58,6 @@ LD_FLAGS += $(LDFLAGS) all: check build test install .PHONY: all -# The below include contains the tools. -include tools/Makefile include test/Makefile ############################################################################### @@ -85,19 +83,10 @@ proto-all: proto-gen proto-lint proto-check-breaking .PHONY: proto-all proto-gen: - ## If you get the following error, - ## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" - ## See https://stackoverflow.com/a/25518702 - ## Note the $< here is substituted for the %.proto - ## Note the $@ here is substituted for the %.pb.go - @sh scripts/protocgen.sh -.PHONY: proto-gen - -proto-gen-docker: @docker pull -q tendermintdev/docker-build-proto @echo "Generating Protobuf files" @docker run -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto sh ./scripts/protocgen.sh -.PHONY: proto-gen-docker +.PHONY: proto-gen proto-lint: @$(DOCKER_BUF) check lint --error-format=json @@ -247,7 +236,7 @@ build-docker: build-linux ############################################################################### # Build linux binary on other platforms -build-linux: tools +build-linux: GOOS=linux GOARCH=amd64 $(MAKE) build .PHONY: build-linux diff --git a/docs/app-dev/abci-cli.md b/docs/app-dev/abci-cli.md index 0149a2513..d558e8cf1 100644 --- a/docs/app-dev/abci-cli.md +++ b/docs/app-dev/abci-cli.md @@ -17,7 +17,6 @@ Next, install the `abci-cli` tool and example applications: ```sh git clone https://github.com/tendermint/tendermint.git cd tendermint -make tools make install_abci ``` diff --git a/docs/app-dev/getting-started.md b/docs/app-dev/getting-started.md index 132258bf9..9ba6bab26 100644 --- a/docs/app-dev/getting-started.md +++ b/docs/app-dev/getting-started.md @@ -34,7 +34,6 @@ Then run ```sh go get github.com/tendermint/tendermint cd $GOPATH/src/github.com/tendermint/tendermint -make tools make install_abci ``` diff --git a/docs/introduction/install.md b/docs/introduction/install.md index 6232d5c32..a08182f51 100644 --- a/docs/introduction/install.md +++ b/docs/introduction/install.md @@ -25,12 +25,6 @@ git clone https://github.com/tendermint/tendermint.git cd tendermint ``` -### Get Tools & Dependencies - -```sh -make tools -``` - ### Compile ```sh diff --git a/tools/Makefile b/tools/Makefile deleted file mode 100644 index fa9081ce2..000000000 --- a/tools/Makefile +++ /dev/null @@ -1,97 +0,0 @@ -### -# Find OS and Go environment -# GO contains the Go binary -# FS contains the OS file separator -### -ifeq ($(OS),Windows_NT) - GO := $(shell where go.exe 2> NUL) - FS := "\\" -else - GO := $(shell command -v go 2> /dev/null) - FS := "/" -endif - -ifeq ($(GO),) - $(error could not find go. Is it in PATH? $(GO)) -endif - -GOPATH ?= $(shell $(GO) env GOPATH) -GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com - -### -# Functions -### - -go_get = $(if $(findstring Windows_NT,$(OS)),\ -IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS) ( mkdir $(GITHUBDIR)$(FS)$(1) ) else (cd .) &\ -IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS)$(2)$(FS) ( cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2) ) else (cd .) &\ -,\ -mkdir -p $(GITHUBDIR)$(FS)$(1) &&\ -(test ! -d $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2)) || true &&\ -)\ -cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && git fetch origin && git checkout -q $(3) - -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd) - -### -# Go tools -### - -TOOLS_DESTDIR ?= $(GOPATH)/bin - -CERTSTRAP = $(TOOLS_DESTDIR)/certstrap -PROTOBUF = $(TOOLS_DESTDIR)/protoc -GOODMAN = $(TOOLS_DESTDIR)/goodman -BUF_VERSION = "0.30.0" -BINARY_NAME = "buf" -BIN = "/usr/local/bin" -OS = $(shell uname -s) -ARCH = $(shell uname -m) - -all: tools -.PHONY: all - -tools: certstrap protobuf goodman -.PHONY: tools - -check: check_tools -.PHONY: check - -check_tools: - @# https://stackoverflow.com/a/25668869 - @echo "Found tools: $(foreach tool,$(notdir $(GOTOOLS)),\ - $(if $(shell which $(tool)),$(tool),$(error "No $(tool) in PATH")))" -.PHONY: check_tools - -certstrap: $(CERTSTRAP) -$(CERTSTRAP): - @echo "Get Certstrap" - @go get github.com/square/certstrap@v1.2.0 -.PHONY: certstrap - -protobuf: $(PROTOBUF) -$(PROTOBUF): - @echo "Get GoGo Protobuf" - @go get github.com/gogo/protobuf/protoc-gen-gogofaster@v1.3.1 -.PHONY: protobuf - -buf: - @echo "Install Buf" - curl -sSL \ - "https://github.com/bufbuild/buf/releases/download/v$(BUF_VERSION)/$(BINARY_NAME)-$(OS)-$(ARCH)" \ - -o "${BIN}/${BINARY_NAME}" && \ - chmod +x "${BIN}/${BINARY_NAME}" -.PHONY: buf - -goodman: $(GOODMAN) -$(GOODMAN): - @echo "Get Goodman" - @go get github.com/snikch/goodman/cmd/goodman@10e37e294daa3c9a90abded60ff9924bafab3888 -.PHONY: goodman - -tools-clean: - rm -f $(CERTSTRAP) $(PROTOBUF) $(GOX) $(GOODMAN) - rm -f tools-stamp - rm -f "${BIN}/${BINARY_NAME}" -.PHONY: tooks-clean