Skip to content

Commit

Permalink
chore: add docker compose demo
Browse files Browse the repository at this point in the history
...

Signed-off-by: HAOYUatHZ <[email protected]>

done
  • Loading branch information
0xmountaintop committed Dec 27, 2019
1 parent 36b3cbf commit 53860ad
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
8 changes: 8 additions & 0 deletions demo/docker_demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

mkdir -p ~/KZen-networks/multi-party-ecdsa/temp/
sudo cp Rocket.toml ~/KZen-networks/multi-party-ecdsa/temp/
sudo cp params ~/KZen-networks/multi-party-ecdsa/temp/
sudo cp demo/run_in_docker.sh ~/KZen-networks/multi-party-ecdsa/temp/

docker-compose up
34 changes: 34 additions & 0 deletions demo/run_in_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

n=`cat params | sed -n 1p`
t=`cat params | sed -n 2p`
params="{\"parties\":\"$n\", \"threshold\":\"$t\"}"

echo "Params: $params"
echo -n $params > params.json
echo "$0: Multi-party ECDSA parties:$n threshold:$t"
sleep 1

./sm_manager &

sleep 2
echo "keygen part"

for i in $(seq 1 $n)
do
echo "key gen for client $i out of $n"
./gg18_keygen_client http://0.0.0.0:8001 keys$i.store &
sleep 3
done



sleep 5
echo "sign"

for i in $(seq 1 $((t+1)));
do
echo "signing for client $i out of $((t+1))"
./gg18_sign_client http://0.0.0.0:8001 keys$i.store "KZen Networks" &
sleep 3
done
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'

services:
multi-party-ecdsa:
image: multi-party-ecdsa
container_name: multi-party-ecdsa
command: bash -c "cp /multi-party-ecdsa/temp/Rocket.toml . &&
cp /multi-party-ecdsa/temp/params . &&
cp /multi-party-ecdsa/temp/run_in_docker.sh . &&
chmod +x ./run_in_docker.sh &&
./run_in_docker.sh"
volumes:
- ~/KZen-networks/multi-party-ecdsa/temp/:/multi-party-ecdsa/temp/

0 comments on commit 53860ad

Please sign in to comment.