Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add Dockerfile for keygen & signing example codes #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HAOYUatHZ
Copy link
Contributor

@HAOYUatHZ HAOYUatHZ commented Dec 17, 2019

This Dockerfile compiles examples/sm_manager.rs, examples/gg18_keygen_client.rs & examples/gg18_sign_client.rs,
and build an docker image for cross-platform use.

@gbenattar
Copy link
Contributor

Can you edit the title and the description before we can merge this PR?

Ideally we would like more details on what this DockerFile will do if we run it.
Thanks!

@HAOYUatHZ HAOYUatHZ changed the title add Dockerfile for demo example chore(): add Dockerfile for keygen & signing example codes Dec 23, 2019
@HAOYUatHZ HAOYUatHZ changed the title chore(): add Dockerfile for keygen & signing example codes chore: add Dockerfile for keygen & signing example codes Dec 23, 2019
@HAOYUatHZ
Copy link
Contributor Author

HAOYUatHZ commented Dec 23, 2019

Can you edit the title and the description before we can merge this PR?

Ideally we would like more details on what this DockerFile will do if we run it.
Thanks!

Hi Gary, I have improved the titles and descriptions in both #87 and #88

Please take a look, thanks!

Copy link
Contributor

@gbenattar gbenattar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gbenattar
Copy link
Contributor

@omershlo You can squash and merge (make sure to select this option).

@omershlo
Copy link
Contributor

@HAOYUatHZ how do I test it on my computer?

@HAOYUatHZ
Copy link
Contributor Author

HAOYUatHZ commented Dec 25, 2019

@omershlo for now u can try it this way

mkdir ~/temp
cp params.json ~/temp/
cp Rocket.toml ~/temp/

docker run -p 8001:8001 -v ~/temp:/multi-party-ecdsa/temp -e ROCKET_ENV=development -it multi-party-ecdsa

once entering the container, run

cp ./temp/* .
./sm_manager

then open another window, run this script

n=`cat params | sed -n 1p`
t=`cat params | sed -n 2p`

rm keys?.store
killall sm_manager gg18_keygen_client gg18_sign_client 2> /dev/null

for i in $(seq 1 $n)
do
    echo "key gen for client $i out of $n"
    ./target/release/examples/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))"
    ./target/release/examples/gg18_sign_client http://0.0.0.0:8001 keys$i.store "KZen Networks" &
    sleep 3
done


Note that this only runs sm_manager inside docker but not keygen_client and sign_client.
So this only proves the docker image building & communication (address binding)
are correct.

I will write a better run.sh to get all binaries running in dockers.

@omershlo
Copy link
Contributor

is there a way to get "1 click" solution?
l

@HAOYUatHZ
Copy link
Contributor Author

is there a way to get "1 click" solution?
l

no problem. I will write a 'run.sh' for it.

...

Signed-off-by: HAOYUatHZ <[email protected]>
@HAOYUatHZ
Copy link
Contributor Author

HAOYUatHZ commented Dec 27, 2019

@omershlo now you can run demo/docker_demo.sh in repo root directory

(But for the first time you will need to run docker build . -t=multi-party-ecdsa to build the image. This has been commented out in https://github.com/KZen-networks/multi-party-ecdsa/pull/88/files#diff-e023b047c4c5d3b9773f8bcf08e71535R4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants