-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
executable file
·45 lines (31 loc) · 1002 Bytes
/
run.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
#!/bin/bash
cd ourgui
NUM_RELAYS=$1
NUM_PROXIES=$2
NUM_MESSAGES=10
NUM_PARALLEL=5
BEGIN_PORT=3000
# Create Directory file
TOTAL=$((NUM_RELAYS+NUM_PROXIES))
CURRENT_PORT=$BEGIN_PORT
> directory.txt
for (( r=1; r<=$TOTAL; r++ ))
do
echo 127.0.0.1:$CURRENT_PORT >> directory.txt
CURRENT_PORT=$((CURRENT_PORT+1))
done
#Run Relays
CURRENT_PORT=$BEGIN_PORT #Reset Current port
for (( r=1; r<=$NUM_RELAYS; r++ ))
do
go run mod.go start --nodeaddr 127.0.0.1:$CURRENT_PORT --directoryfilename directory.txt > ../logs/$CURRENT_PORT.log &
CURRENT_PORT=$((CURRENT_PORT+1))
done
#Run Proxies
for (( r=1; r<=$NUM_PROXIES; r++ ))
do
go run mod.go start --nodeaddr 127.0.0.1:$CURRENT_PORT --directoryfilename directory.txt --messages $NUM_MESSAGES --parallel $NUM_PARALLEL --proxy > ../logs/$CURRENT_PORT.log &
# go run mod.go start --nodeaddr 127.0.0.1:$CURRENT_PORT --directoryfilename directory.txt --proxy > ../logs/$CURRENT_PORT.log &
CURRENT_PORT=$((CURRENT_PORT+1))
done
sleep 60000