erigon-pulse/Makefile
Alex Sharov bb6dfef7c8
add downloader.proto (#206)
* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit be07fc9

git-subtree-dir: interfaces
git-subtree-split: be07fc99183a7cef1ca08961033bdb917d85d9b5

* save

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit be07fc9

git-subtree-dir: interfaces
git-subtree-split: be07fc99183a7cef1ca08961033bdb917d85d9b5

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit 23d68fd

git-subtree-dir: interfaces
git-subtree-split: 23d68fda86c3a2c322e7b430c817b06b6f6ca311

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit 500dde8

git-subtree-dir: interfaces
git-subtree-split: 500dde8293c0a12d19d94b5ff633722a03d7fc4e

* save

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit e5b1945

git-subtree-dir: interfaces
git-subtree-split: e5b1945d02da7a7f00e2289034ee90a6edd60184

* save

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit f36d878

git-subtree-dir: interfaces
git-subtree-split: f36d878080fe018a41fb903f81fc8f8ac9981cbd

* save

* save

* save
2021-12-14 13:33:32 +00:00

51 lines
1.8 KiB
Makefile

GOBIN = $(CURDIR)/build/bin
GOBUILD = env GO111MODULE=on go build -trimpath
OS = $(shell uname -s)
ARCH = $(shell uname -m)
ifeq ($(OS),Darwin)
PROTOC_OS := osx
endif
ifeq ($(OS),Linux)
PROTOC_OS = linux
endif
gen: grpc mocks
grpc:
mkdir -p ./build/bin/
rm -f ./build/bin/protoc*
rm -rf ./build/include*
$(eval PROTOC_TMP := $(shell mktemp -d))
cd $(PROTOC_TMP); curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v3.18.0/protoc-3.18.0-$(PROTOC_OS)-$(ARCH).zip -o protoc.zip
cd $(PROTOC_TMP); unzip protoc.zip && mv bin/protoc "$(GOBIN)" && mv include "$(GOBIN)"/..
$(GOBUILD) -o "$(GOBIN)"/protoc-gen-go google.golang.org/protobuf/cmd/protoc-gen-go # generates proto messages
$(GOBUILD) -o "$(GOBIN)"/protoc-gen-go-grpc google.golang.org/grpc/cmd/protoc-gen-go-grpc # generates grpc services
PATH="$(GOBIN)":"$(PATH)" protoc --proto_path=interfaces --go_out=gointerfaces -I=build/include/google \
types/types.proto
PATH="$(GOBIN)":"$(PATH)" protoc --proto_path=interfaces --go_out=gointerfaces --go-grpc_out=gointerfaces -I=build/include/google \
--go_opt=Mtypes/types.proto=github.com/ledgerwatch/erigon-lib/gointerfaces/types \
--go-grpc_opt=Mtypes/types.proto=github.com/ledgerwatch/erigon-lib/gointerfaces/types \
p2psentry/sentry.proto \
remote/kv.proto remote/ethbackend.proto \
downloader/downloader.proto \
consensus_engine/consensus.proto \
testing/testing.proto \
txpool/txpool.proto txpool/mining.proto
mocks:
$(GOBUILD) -o "$(GOBIN)"/moq github.com/matryer/moq
PATH="$(GOBIN)":"$(PATH)" go generate ./...
lint:
@./build/bin/golangci-lint run --config ./.golangci.yml
lintci-deps:
rm -f ./build/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.42.1