-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
executable file
·111 lines (76 loc) · 3.23 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
PACKAGES=$(shell GO111MODULE=on go list -mod=readonly ./...)
MODULES = argument backing category challenge expiration stake story
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=truchaind \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(ldflags)'
define \n
endef
benchmark:
@go test -mod=readonly -bench=. $(PACKAGES)
buidl: build
build: build_cli build_daemon
download:
go mod download
build_cli:
@go build $(BUILD_FLAGS) -o bin/truchaincli cmd/truchaincli/*.go
build_daemon:
@go build $(BUILD_FLAGS) -o bin/truchaind cmd/truchaind/*.go
build-linux:
GOOS=linux GOARCH=amd64 go build -mod=readonly $(BUILD_FLAGS) -o build/truchaind cmd/truchaind/*.go
GOOS=linux GOARCH=amd64 go build -mod=readonly $(BUILD_FLAGS) -o build/truchaincli cmd/truchaincli/*.go
doc:
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/TruStory/truchain/"
godoc -http=:6060
export:
@bin/truchaind export
create-wallet:
bin/truchaincli keys add validator --home ~/.octopus
init:
rm -rf ~/.truchaind
bin/truchaind init trunode $(shell bin/truchaincli keys show validator -a --home ~/.octopus)
bin/truchaind add-genesis-account $(shell bin/truchaincli keys show validator -a --home ~/.octopus) 10000000000utru
bin/truchaind gentx --name=validator --amount 10000000000utru --home-client ~/.octopus
bin/truchaind collect-gentxs
install:
@go install $(BUILD_FLAGS) ./cmd/truchaind
@go install $(BUILD_FLAGS) ./cmd/truchaincli
@echo "Installed truchaind and truchaincli ..."
@truchaind version --long
reset:
bin/truchaind unsafe-reset-all
restart: build_daemon reset start
start:
bin/truchaind start --inv-check-period 10 --log_level "main:info,state:info,*:error,app:info,account:info,trubank:info,claim:info,community:info,truslashing:info,trustaking:info"
check:
@echo "--> Running golangci"
@golangci-lint run --tests=false --skip-files=\\btest_common.go
dep_graph: ; $(foreach dir, $(MODULES), godepgraph -s -novendor github.com/TruStory/truchain/x/$(dir) | dot -Tpng -o x/$(dir)/dep.png${\n})
install_tools_macos:
brew install dep && brew upgrade dep
brew install golangci/tap/golangci-lint
brew upgrade golangci/tap/golangci-lint
go_test:
@go test $(PACKAGES)
test: go_test
test_cover:
@go test $(PACKAGES) -v -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic
@go tool cover -html=coverage.txt
version:
@bin/truchaind version --long
########################################
### Local validator nodes using docker and docker-compose
build-docker-truchaindnode:
$(MAKE) -C networks/local
# Run a 4-node testnet locally
localnet-start: localnet-stop
@if ! [ -f build/node0/truchaind/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/truchaind:Z trustory/truchaindnode testnet --v 4 -o . --starting-ip-address 192.168.10.2 ; fi
docker-compose up -d
# Stop testnet
localnet-stop:
docker-compose down
########################################
.PHONY: benchmark buidl build build_cli build_daemon check dep_graph test test_cover update_deps \
build-docker-truchaindnode localnet-start localnet-stop