-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
59 lines (45 loc) · 1.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
PACKAGE := github.com/zondax/rosetta-filecoin-proxy/rosetta/services
REVISION := $(shell git rev-parse --short HEAD)
ROSETTASDKVER := $(shell go list -m all | grep '^github.com/coinbase/rosetta-sdk-go ' | awk '{print $$2}')
LOTUSVER := $(shell go list -m all | grep github.com/filecoin-project/lotus | awk '{print $$2}')
RETRYNUM := 10
ROSETTAPORT_CI := 8081
APPNAME := rosetta-filecoin-proxy
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
export LIBRARY_PATH=$(shell brew --prefix hwloc)/lib
export LDFLAGS="-L$(LIBRARY_PATH)"
export LD_LIBRARY_PATH=$(LIBRARY_PATH)
export RUSTFLAGS="-C target-cpu=native -g"
export FFI_BUILD_FROM_SOURCE=0
endif
.PHONY: build
build: build_ffi
go build -ldflags "-X $(PACKAGE).GitRevision=$(REVISION) -X $(PACKAGE).RosettaSDKVersion=$(ROSETTASDKVER) \
-X $(PACKAGE).LotusVersion=$(LOTUSVER)" -o $(APPNAME)
build_CI: build_ffi
go build -ldflags "-X $(PACKAGE).GitRevision=$(REVISION) -X $(PACKAGE).RosettaSDKVersion=$(ROSETTASDKVER) \
-X $(PACKAGE).LotusVersion=$(LOTUSVER) -X $(PACKAGE).RetryConnectAttempts=$(RETRYNUM) \
-X $(PACKAGE).RosettaServerPort=$(ROSETTAPORT_CI)" -o $(APPNAME)
clean:
go clean
build_ffi:
make -C extern/filecoin-ffi
install_lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.45.2
check-modtidy:
go mod tidy
git diff --exit-code -- go.mod go.sum
lint:
golangci-lint --version
golangci-lint run -E gofmt -E gosec -E goconst -E gocritic
# golangci-lint run -E stylecheck -E gosec -E goconst -E godox -E gocritic
test: build
go test -race ./rosetta/services
test_integration: build
go test -race ./rosetta/tests
gitclean:
git clean -xfd
git submodule foreach --recursive git clean -xfd
test_calibration_macos: build
LOTUS_RPC_URL=https://node-fil-calibration-light.zondax.dev/rpc/v1 ./rosetta-filecoin-proxy &