-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas Braun
committed
Nov 22, 2023
1 parent
32c6eab
commit c1eac34
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM rust:latest | ||
|
||
WORKDIR /usr/src/client | ||
COPY . . | ||
RUN apt-get update && apt-get install -y protobuf-compiler netcat-traditional | ||
ENTRYPOINT ["./docker/client/client.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
trap "exit" INT TERM | ||
trap "kill 0" EXIT | ||
|
||
echo "Server addr: $SERVER_IP:$SERVER_PORT" | ||
|
||
cargo build --release --example zknode | ||
|
||
# Retry loop | ||
while ! nc -z -w 5 $SERVER_IP $SERVER_PORT; do | ||
echo "Waiting for server $SERVER_IP:$SERVER_PORT ... " | ||
sleep 0.5 | ||
done | ||
|
||
PROCS=() | ||
n=8 | ||
for i in {1..7} | ||
do | ||
RUST_LOG=debug cargo run --release --example zknode -- --n $n --king-ip $SERVER_IP:$SERVER_PORT --public-identity-der certs/$i/cert.der --client-only-king-public-identity-der certs/0/cert.der --watch-dir target/zk --name node$i --i $i --private-identity-der certs/$i/key.der & | ||
pid=$! | ||
PROCS[$i]=$pid | ||
done | ||
|
||
# Step 5: wait for all processes to finish | ||
for pid in ${PROCS[@]}; do | ||
wait $pid | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM rust:latest | ||
|
||
WORKDIR /usr/src/server | ||
COPY . . | ||
RUN apt-get update && apt-get install -y protobuf-compiler | ||
RUN sleep 15 # give time for the clients to get ahead in compiling | ||
CMD RUST_LOG=debug cargo run --release --example zknode -- --n 8 --king-ip $BIND_ADDRESS --public-identity-der certs/0/cert.der --watch-dir target/zk --name king --i 0 --private-identity-der certs/0/key.der |