-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile
141 lines (140 loc) · 7.3 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
PROJECT_NAME := "dusk-blockchain"
PKG := "github.com/dusk-network/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
#TEST_FLAGS := "-count=1"
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
.PHONY: all dep build clean test coverage coverhtml lint
all: build
lint: ## Lint the files
GOBIN=$(PWD)/bin go run scripts/build.go lint
go-analyzer: ## Run go-analyzer
GOBIN=$(PWD)/bin go run scripts/build.go go-analyzer
test: ## Run unittests
go test $(TFLAGS) -short ${PKG_LIST}
test-harness-unit: build ## Run a specified harness unit test e.g make UNIT_TEST=TestForgedBlock test-harness-unit
MOCK_ADDRESS=127.0.0.1:8080 DUSK_NETWORK_SIZE=9 DUSK_BLOCKCHAIN=${PWD}/bin/dusk DUSK_UTILS=${PWD}/bin/utils DUSK_SEEDER=${PWD}/bin/voucher DUSK_WALLET_PASS="password" RUSK_PATH=${PWD}/bin/rusk \
go test -v --count=1 --test.timeout=0 ./harness/tests/ -run $(UNIT_TEST) -args -enable
test-harness: ## Run harness tests
@go test -v --count=1 --test.timeout=0 ./harness/tests/ -args -enable
test-harness-ci: stop rusk build
DUSK_NETWORK_PROFILE=kadcast_uds RUSK_PATH=${PWD}/bin/rusk DUSK_NETWORK_SIZE=5 DUSK_UTILS=${PWD}/bin/utils DUSK_SEEDER=${PWD}/bin/voucher \
DUSK_BLOCKCHAIN=${PWD}/bin/dusk DUSK_WALLET_PASS="password" make test-harness
test-harness-alive: stop build
MOCK_ADDRESS=127.0.0.1:9191 DUSK_NETWORK_SIZE=9 DUSK_BLOCKCHAIN=${PWD}/bin/dusk DUSK_UTILS=${PWD}/bin/utils DUSK_SEEDER=${PWD}/bin/voucher DUSK_WALLET_PASS="password" \
go test -v --count=1 --test.timeout=0 ./harness/tests/ -run TestMultipleProvisioners -args -enable -keepalive
test-harness-tps: stop build
MOCK_ADDRESS=127.0.0.1:9191 DUSK_BLOCKCHAIN=${PWD}/bin/dusk DUSK_UTILS=${PWD}/bin/utils DUSK_SEEDER=${PWD}/bin/voucher RUSK_PATH=${PWD}/bin/rusk \
go test -v --count=1 --test.timeout=0 ./harness/tests/ -run TestMeasureNetworkTPS -args -enable -keepalive
test-harness-session:
REQUIRE_SESSION=true make test-harness-alive
test-harness-race-alive: stop build-race
MOCK_ADDRESS=127.0.0.1:9191 DUSK_NETWORK_SIZE=9 DUSK_BLOCKCHAIN=${PWD}/bin/dusk DUSK_UTILS=${PWD}/bin/utils DUSK_SEEDER=${PWD}/bin/voucher DUSK_WALLET_PASS="password" \
go test -v --count=1 --test.timeout=0 ./harness/tests/ -run TestMultipleProvisioners -args -enable -keepalive
test-harness-race-debug-alive: stop build-race-debug
MOCK_ADDRESS=127.0.0.1:9191 DUSK_NETWORK_SIZE=9 DUSK_BLOCKCHAIN=${PWD}/bin/dusk DUSK_UTILS=${PWD}/bin/utils DUSK_SEEDER=${PWD}/bin/voucher DUSK_WALLET_PASS="password" \
go test -v --count=1 --test.timeout=0 ./harness/tests/ -run TestMultipleProvisioners -args -enable -keepalive
race: dep ## Run data race detector
@go test $(TFLAGS) -race -v ${PKG_LIST}
coverage: ## Generate global code coverage report
chmod u+x coverage.sh
./coverage.sh;
coverhtml: ## Generate global code coverage report in HTML
chmod u+x coverage.sh
./coverage.sh html;
dep: ## Get the dependencies
go mod download
build: dep ## Build the binary file
GOBIN=$(PWD)/bin go run scripts/build.go install
build-race: dep ## Build the binary file
GOBIN=$(PWD)/bin go run scripts/build.go install -race
build-race-debug: dep ## Build the binary file
GOBIN=$(PWD)/bin go run scripts/build.go install -race -debug
clean: ## Remove previous build
@rm -rf ./bin
@go clean -testcache
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
dusk: build
./bin/dusk --config=dusk.toml
voucher: build
./bin/voucher
wallet: build
./bin/wallet
mock: build
./bin/utils mock --grpcmockhost=127.0.0.1:9191
mockrusk: build
./bin/utils mockrusk --rusknetwork=tcp --ruskaddress=127.0.0.1:10000 \
--walletstore=/tmp/localnet-137601832/node-9003/walletDB/ \
--walletfile=./harness/data/wallet-9000.dat
rusk:
rm -rf rusk_co
git clone https://github.com/dusk-network/rusk rusk_co \
&& cd rusk_co \
&& make wasm \
&& cargo b --release -p rusk-recovery --features state -Z unstable-options --out-dir ../bin/ \
&& cargo b --release -p rusk -Z unstable-options --out-dir ../bin/
rm -rf rusk_co
devnet: stop
./devnet.sh
netcollector: build
./bin/netcollector
stop:
echo "will stop dusk app"
killall dusk || true
killall voucher || true
killall utils || true
killall filebeat || true
###################################CROSS#################################################
install-tools:
go get -u github.com/karalabe/xgo
cross: \
dusk-linux dusk-linux-arm dusk-darwin dusk-windows \
voucher-linux voucher-linux-arm voucher-darwin voucher-windows \
wallet-linux wallet-linux-arm wallet-darwin wallet-windows
###################################DUSK#################################################
dusk-linux: install-tools
xgo --go=latest --targets=linux/amd64 -out=./bin/dusk ./cmd/dusk
xgo --go=latest --targets=linux/386 -out=./bin/dusk ./cmd/dusk
dusk-linux-arm: install-tools
xgo --go=latest --targets=linux/arm-5 -out=./bin/dusk ./cmd/dusk
xgo --go=latest --targets=linux/arm-6 -out=./bin/dusk ./cmd/dusk
xgo --go=latest --targets=linux/arm-7 -out=./bin/dusk ./cmd/dusk
xgo --go=latest --targets=linux/arm64 -out=./bin/dusk ./cmd/dusk
dusk-darwin: install-tools
xgo --go=latest --targets=darwin/amd64 -out=./bin/dusk ./cmd/dusk
xgo --go=latest --targets=darwin/386 -out=./bin/dusk ./cmd/dusk
dusk-windows: install-tools
#xgo --go=latest --targets=windows/amd64 -out=./bin/dusk ./cmd/dusk #407
#xgo --go=latest --targets=windows/386 -out=./bin/dusk ./cmd/dusk #407
###################################VOUCHER##############################################
voucher-linux: install-tools
xgo --go=latest --targets=linux/amd64 -out=./bin/voucher ./cmd/voucher
xgo --go=latest --targets=linux/386 -out=./bin/voucher ./cmd/voucher
voucher-linux-arm: install-tools
xgo --go=latest --targets=linux/arm-5 -out=./bin/voucher ./cmd/voucher
xgo --go=latest --targets=linux/arm-6 -out=./bin/voucher ./cmd/voucher
xgo --go=latest --targets=linux/arm-7 -out=./bin/voucher ./cmd/voucher
xgo --go=latest --targets=linux/arm64 -out=./bin/voucher ./cmd/voucher
voucher-darwin: install-tools
xgo --go=latest --targets=darwin/amd64 -out=./bin/voucher ./cmd/voucher
xgo --go=latest --targets=darwin/386 -out=./bin/voucher ./cmd/voucher
voucher-windows: install-tools
xgo --go=latest --targets=windows/amd64 -out=./bin/voucher ./cmd/voucher
xgo --go=latest --targets=windows/386 -out=./bin/voucher ./cmd/voucher
###################################WALLET###############################################
wallet-linux: install-tools
xgo --go=latest --targets=linux/amd64 -out=./bin/wallet ./cmd/wallet
xgo --go=latest --targets=linux/386 -out=./bin/wallet ./cmd/wallet
wallet-linux-arm: install-tools
xgo --go=latest --targets=linux/arm-5 -out=./bin/wallet ./cmd/wallet
xgo --go=latest --targets=linux/arm-6 -out=./bin/wallet ./cmd/wallet
xgo --go=latest --targets=linux/arm-7 -out=./bin/wallet ./cmd/wallet
xgo --go=latest --targets=linux/arm64 -out=./bin/wallet ./cmd/wallet
wallet-darwin: install-tools
xgo --go=latest --targets=darwin/amd64 -out=./bin/wallet ./cmd/wallet
xgo --go=latest --targets=darwin/386 -out=./bin/wallet ./cmd/wallet
wallet-windows: install-tools
#xgo --go=latest --targets=windows/amd64 -out=./bin/wallet ./cmd/wallet #407
#xgo --go=latest --targets=windows/386 -out=./bin/wallet ./cmd/wallet #407
########################################################################################
.PHONY: rusk