Skip to content

Commit 7598c04

Browse files
authored
Merge pull request #168 from dedis/minor-doc-update
Adds minor doc and script updates
2 parents dfd8fc1 + 5fb7933 commit 7598c04

File tree

2 files changed

+49
-15
lines changed

2 files changed

+49
-15
lines changed

README.md

+35-11
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ results.
360360

361361
# ⚙️ Setup
362362

363-
First be sure to have Go installed (at least 1.19).
363+
1: Install [Go](https://go.dev/dl/) (at least 1.19).
364364

365-
Be sure to have the `crypto` utility from Dela:
365+
2: Install the `crypto` utility from Dela:
366366

367367
```sh
368368
git clone https://github.com/dedis/dela.git
@@ -373,29 +373,53 @@ go install
373373
Go will install the binaries in `$GOPATH/bin`, so be sure this it is correctly
374374
added to you path (like with `export PATH=$PATH:/Users/david/go/bin`).
375375

376-
Create a private key (in the d-voting root folder):
376+
3: [Install tmux](https://github.com/tmux/tmux/wiki/Installing)
377+
378+
# Setup a simple system with 3 nodes
379+
380+
1: Run 3 nodes:
377381

378382
```sh
379-
crypto bls signer new --save private.key
383+
./runNode.sh -n 3
380384
```
381385

382-
Copy the private key from the d-voting root folder to the `cli/memcoin` folder:
386+
This will run 4 terminal sessions. You can navigate by hitting
387+
<kbd>CTRL</kbd>+<kbd>B</kbd> and then <kbd>S</kbd>. Use the arrows to select a
388+
window.
389+
390+
2: Launch the setup
391+
392+
From the first terminal sessions, run:
383393

384394
```sh
385-
cp private.key cli/memcoin/
395+
./setupnNode.sh -n 3
386396
```
387397

388-
Install memcoin (this requires the private key in `cli/memcoin`):
398+
3: Launch the web backend
389399

390400
```sh
391-
cd cli/memcoin
392-
go install
401+
cd web/backend
402+
# if this is the first time, run `npm install` first
403+
npm start
393404
```
394405

395-
Additionally, you can build the memcoin binary with:
406+
4: Launch the web frontend
407+
408+
```sh
409+
cd web/frontend
410+
# if this is the first time, run `npm install` first
411+
REACT_APP_PROXY=http://localhost:9081 REACT_APP_NOMOCK=on npm start
412+
```
413+
414+
Note that you need to be on EPFL's network to login with Tequila. Additionally,
415+
once logged with Tequila, update the redirect URL and replace
416+
`dvoting-dev.dedis.ch` with `localhost`. Once logged, you can create an
417+
election.
418+
419+
5: Stop nodes
396420

397421
```sh
398-
go build ./cli/memcoin
422+
./kill_test.sh
399423
```
400424

401425
# Run the nodes

runNode.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# an evoting system. User can pass number of nodes, window attach mode useful for autotest,
55
# and docker usage.
66

7+
set -e
8+
79
# by default run on local
810
DOCKER=false
911
ATTACH=true
@@ -68,11 +70,10 @@ tmux new-session -d -s $s
6870
rm -rf ./log/log
6971
mkdir -p ./log/log
7072

71-
72-
73+
crypto bls signer new --save private.key --force
7374

7475
if [ "$DOCKER" == false ]; then
75-
make build
76+
go build -o memcoin ./cli/memcoin
7677
else
7778
# Clean created containers and tmp dir
7879
if [[ $(docker ps -a -q --filter ancestor=node) ]]; then
@@ -97,7 +98,16 @@ tmux new-window -t $s
9798
window=$from
9899

99100
if [ "$DOCKER" == false ]; then
100-
tmux send-keys -t $s:$window "PROXY_LOG=info LLVL=info ./memcoin --config /tmp/node$from start --postinstall --promaddr :$((9099 + $from)) --proxyaddr :$((9079 + $from)) --proxykey $pk --listen tcp://0.0.0.0:$((2000 + $from)) --public //localhost:$((2000 + $from))| tee ./log/log/node$from.log" C-m
101+
tmux send-keys -t $s:$window "PROXY_LOG=info LLVL=info ./memcoin \
102+
--config /tmp/node$from \
103+
start \
104+
--postinstall \
105+
--promaddr :$((9099 + $from)) \
106+
--proxyaddr :$((9079 + $from)) \
107+
--proxykey $pk \
108+
--listen tcp://0.0.0.0:$((2000 + $from)) \
109+
--routing tree \
110+
--public //localhost:$((2000 + $from))| tee ./log/log/node$from.log" C-m
101111
else
102112
docker run -d -it --env LLVL=info --name node$from --network evoting-net -v "$(pwd)"/nodedata:/tmp --publish $(( 9079+$from )):9080 node
103113
tmux send-keys -t $s:$window "docker exec node$from memcoin --config /tmp/node$from start --postinstall \

0 commit comments

Comments
 (0)