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
from

Conversation

@HAOYUatHZ
Copy link
Contributor

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.

HAOYUatHZ added a commit to ChrisLinn/chrislinn.ink that referenced this pull request Dec 17, 2019
@omershlo omershlo requested a review from gbenattar Dec 19, 2019
@gbenattar

This comment has been minimized.

Copy link
Member

gbenattar 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!

@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

This comment has been minimized.

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
Member

gbenattar left a comment

LGTM

@gbenattar

This comment has been minimized.

Copy link
Member

gbenattar commented Dec 24, 2019

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

@omershlo

This comment has been minimized.

Copy link
Member

omershlo commented Dec 24, 2019

@HAOYUatHZ how do I test it on my computer?

@HAOYUatHZ

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

omershlo commented Dec 26, 2019

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

@HAOYUatHZ

This comment has been minimized.

Copy link
Contributor Author

HAOYUatHZ commented Dec 27, 2019

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

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

...

Signed-off-by: HAOYUatHZ <haoyu@protonmail.com>
@HAOYUatHZ HAOYUatHZ force-pushed the HAOYUatHZ:docker branch from 53860ad to 11055fd Dec 27, 2019
@HAOYUatHZ

This comment has been minimized.

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
Projects
None yet
3 participants
You can’t perform that action at this time.