-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·74 lines (65 loc) · 3.5 KB
/
build.sh
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
#!/usr/bin/env bash
rm -rf ./build
mkdir -p ./build/tests/network
mkdir -p ./build/clients
cd ./tests/network
echo 'Generating network graph...'
python3 generate_symmetric_graph_same_ip.py $1
echo -e 'Done\n'
cd ..
#echo 'Compiling tests...'
#go test -c -o ../cluster/tests/tests.test
#echo -e 'Done\n'
cd ..
cp ./tests/network/config.json ./build/tests/network/config.json
cp ./tests/network/generate_symmetric_graph_same_ip.py ./build/tests/network/generate_symmetric_graph_same_ip.py
cp ./tests/runNetwork.sh ./build/tests/runNetwork.sh
# cp ./tests/sendReqsAndCalcTime.sh ./build/tests/sendReqsAndCalcTime.sh
echo 'Generating proto files...'
protoc -I proto/ --go_out=plugins=grpc:proto --go_opt=paths=source_relative proto/node.proto
echo -e 'Done\n'
echo 'Building go files...'
# for BRC cluster use
env GOOS=linux GOARCH=amd64 go build -o ./build/gossipUp ./gossipUp.go
env GOOS=linux GOARCH=amd64 go build -o ./build/snowballUp ./snowballUp.go
env GOOS=linux GOARCH=amd64 go build -o ./build/pbftUp ./pbftUp.go
env GOOS=linux GOARCH=amd64 go build -o ./build/lbftUp ./lbftUp.go
# client files
env GOOS=linux GOARCH=amd64 go build -o ./build/clients/gossipClient ./client/gossipClient.go
env GOOS=linux GOARCH=amd64 go build -o ./build/clients/snowballClient ./client/snowballClient.go
env GOOS=linux GOARCH=amd64 go build -o ./build/clients/pbftClient ./client/pbftClient.go
env GOOS=linux GOARCH=amd64 go build -o ./build/clients/lbftClient ./client/lbftClient.go
# test files
# env GOOS=linux GOARCH=amd64 go build -o ./build/tests/testSendRequests ./tests/testSendRequests.go
env GOOS=linux GOARCH=amd64 go build -o ./build/tests/calcExecTime ./tests/calcExecTime.go
# for local computer use
# if [[ "$OSTYPE" == "darwin"* ]]
# then
# # node up files
# env GOOS=darwin GOARCH=amd64 go build -o ./build/gossipUp ./gossipUp.go
# env GOOS=darwin GOARCH=amd64 go build -o ./build/snowballUp ./snowballUp.go
# env GOOS=darwin GOARCH=amd64 go build -o ./build/pbftUp ./pbftUp.go
# env GOOS=darwin GOARCH=amd64 go build -o ./build/lbftUp ./lbftUp.go
# # client files
# env GOOS=darwin GOARCH=amd64 go build -o ./build/clients/gossipClient ./client/gossipClient.go
# env GOOS=darwin GOARCH=amd64 go build -o ./build/clients/snowballClient ./client/snowballClient.go
# env GOOS=darwin GOARCH=amd64 go build -o ./build/clients/pbftClient ./client/pbftClient.go
# env GOOS=darwin GOARCH=amd64 go build -o ./build/clients/lbftClient ./client/lbftClient.go
# # test files
# # env GOOS=darwin GOARCH=amd64 go build -o ./build//tests/testSendRequests ./tests/testSendRequests.go
# env GOOS=darwin GOARCH=amd64 go build -o ./build/tests/calcExecTime ./tests/calcExecTime.go
# else
# # node up files
# env GOOS=linux GOARCH=amd64 go build -o ./build/gossipUp ./gossipUp.go
# env GOOS=linux GOARCH=amd64 go build -o ./build/snowballUp ./snowballUp.go
# env GOOS=linux GOARCH=amd64 go build -o ./build/pbftUp ./pbftUp.go
# # client files
# env GOOS=linux GOARCH=amd64 go build -o ./build/clients/gossipClient ./client/gossipClient.go
# env GOOS=linux GOARCH=amd64 go build -o ./build/clients/snowballClient ./client/snowballClient.go
# env GOOS=linux GOARCH=amd64 go build -o ./build/clients/pbftClient ./client/pbftClient.go
# env GOOS=linux GOARCH=amd64 go build -o ./build/clients/lbftClient ./client/lbftClient.go
# # test files
# # env GOOS=linux GOARCH=amd64 go build -o ./build/tests/testSendRequests ./tests/testSendRequests.go
# env GOOS=linux GOARCH=amd64 go build -o ./build/tests/calcExecTime ./tests/calcExecTime.go
# fi
echo -e 'Done\n'