Skip to content

Commit b56fbc6

Browse files
committed
Updating scripts
Add the latest changes to the frontend API to the script. Also removes the setup of the certificates, which is not needed for grpc.
1 parent 28ad738 commit b56fbc6

File tree

4 files changed

+12
-31
lines changed

4 files changed

+12
-31
lines changed

scripts/README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Scripts for running D-voting locally
22

3-
The following scripts are available to configure and run D-voting locally. They should be called in this order:
3+
The following scripts are available to configure and run D-voting locally.
4+
They should be called in this order:
45

56
- `run_local.sh` - sets up a complete system with 4 nodes, the db, the authentication-server,
67
and the frontend.
@@ -10,8 +11,14 @@ The following scripts are available to configure and run D-voting locally. They
1011
For debugging Dela, you still need to re-run everything.
1112
- `local_proxies.sh` needs to be run once after the `run_local.sh` script
1213
- `local_forms.sh` creates a new form and prints its ID
13-
- `local_votes.sh` casts the given number of votes. THE ENCRYPTION IS WRONG AND WILL NOT WORK. But it allows to test
14-
missing votes
14+
15+
Every script must be called from the root of the repository:
16+
17+
```bash
18+
./scripts/run_local.sh
19+
./scripts/local_proxies.sh
20+
./scripts/local_forms.sh
21+
```
1522

1623
The following script is only called by the other scripts:
1724

scripts/local_forms.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
44
. "$SCRIPT_DIR/local_login.sh"
55

66
echo "add form"
7-
RESP=$(curl -sk "$FRONTEND_URL/api/evoting/forms" -X POST -H 'Content-Type: application/json' -b cookies.txt --data-raw '{"Title":{"En":"Something","Fr":"","De":""},"Scaffold":[{"ID":"99hYV4uy","Title":{"En":"More stuff","Fr":"","De":""},"Order":["0c7RSRKs"],"Ranks":[],"Selects":[{"ID":"0c7RSRKs","Title":{"En":"Choose","Fr":"","De":""},"MaxN":3,"MinN":1,"Choices":[{"Choice":"{\"en\":\"First\"}","URL":""},{"Choice":"{\"en\":\"Second\"}","URL":""},{"Choice":"{\"en\":\"Third\"}","URL":""}],"Hint":{"En":"","Fr":"","De":""}}],"Texts":[],"Subjects":[]}]}')
7+
FORMJSON='{"Configuration":{"Title":{"En":"title","Fr":"","De":"","URL":""},"Scaffold":[{"ID":"ozCI7gKv","Title":{"En":"subtitle","Fr":"","De":"","URL":""},"Order":["nVjQ0jMK"],"Ranks":[],"Selects":[{"ID":"nVjQ0jMK","Title":{"En":"vote","Fr":"","De":"","URL":""},"MaxN":3,"MinN":1,"Choices":[{"Choice":"{\"en\":\"one\"}","URL":""},{"Choice":"{\"en\":\"two\"}","URL":""},{"Choice":"{\"en\":\"three\"}","URL":""}],"Hint":{"En":"","Fr":"","De":""}}],"Texts":[],"Subjects":[]}],"AdditionalInfo":""}}'
8+
RESP=$(curl -sk "$FRONTEND_URL/api/evoting/forms" -X POST -H 'Content-Type: application/json' -b cookies.txt --data-raw "$FORMJSON")
89
FORMID=$(echo "$RESP" | jq -r .FormID)
910
echo "FORMID=$FORMID" > "$SCRIPT_DIR/formid.env"
1011

scripts/local_votes.sh

-20
This file was deleted.

scripts/run_local.sh

-7
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,6 @@ function init_nodes() {
9494

9595
function init_dela() {
9696
echo "Initializing dela"
97-
echo " Share the certificate"
98-
for n in $(seq 2 4); do
99-
TOKEN_ARGS=$(dvoting --config ./nodes/node-1 minogrpc token)
100-
NODEDIR=./nodes/node-$n
101-
dvoting --config $NODEDIR minogrpc join --address grpc://localhost:2000 $TOKEN_ARGS
102-
done
103-
10497
echo " Create a new chain with the nodes"
10598
for n in $(seq 4); do
10699
NODEDIR=./nodes/node-$n

0 commit comments

Comments
 (0)