From 84cf629cd9f2a8e570f972acd17217a43e574f0a Mon Sep 17 00:00:00 2001 From: jiangyuanshu <317787106@qq.com> Date: Mon, 20 Jan 2020 18:28:10 +0800 Subject: [PATCH] add compute.sh --- README.md | 24 ++++++++++++------------ compute.sh | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) create mode 100755 compute.sh diff --git a/README.md b/README.md index 9be2eb3..de61b98 100644 --- a/README.md +++ b/README.md @@ -20,34 +20,34 @@ This document is a guide to participating in Multi-party Computation(MPC) phase   On Windows, please go to [rust](https://www.rust-lang.org/learn/get-started) homepage for installation instruction, then jump to next step. -  On Linux/Mac, Run the following code in your terminal to download Rustup and install Rust, then follow the instructions if you are running on macOS / Linux / another Unix-like OS: -``` -# curl https://sh.rustup.rs -sSf | sh -``` - -   run as prompted after installation: -``` -# source $HOME/.cargo/env -``` -  You may also need to run on Mac os: +  On Mac, install xcode command line tools first: ``` # xcode-select --install ``` + 6. Obtain the source code of project mpc: ``` # git clone https://github.com/tronprotocol/mpc ```   If git has not been installed on your computer, please refer to [git](https://git-scm.com/downloads) first. -7. In the mpc directory, download `params` file, then run: +7. On Mac/Linux, in the mpc directory, run following command in your terminal and choose 1 in the following selection: +``` +# sh compute.sh +``` + +  On Windows, in the mpc directory, download `params` file, then run: ``` # cargo run --release --bin compute ``` +   When it’s finished, you will get a `new_params` file and a `hash` which you must need to record. You can find the `hash` and `new_params` as shown below: -![](https://raw.githubusercontent.com/tronprotocol/documentation-en/master/docs_without_index/internal-test/sapling-output.jpg) +![](https://raw.githubusercontent.com/tronprotocol/documentation-en/master/docs_without_index/internal-test/mpc-output.jpg) +   Notice: this process could take 0.5 ~ 1 hours according to your hardware capacity and occupy 1.5 ~ 2GB of memory. + 8. Send your result to TRONZ. Send the file `new_params` by keybase, send `hash` string by email. Feel free to state your os version in email. E.g. windows 7/centos 7. ## Dependency diff --git a/compute.sh b/compute.sh new file mode 100755 index 0000000..15839e1 --- /dev/null +++ b/compute.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# install rust +if [[ `rustc -V | grep '('` = '' ]] +then +curl https://sh.rustup.rs -sSf | sh +source $HOME/.cargo/env +fi + +# download params file +echo "download params: "$1 +wget --no-check-certificate $1 + +# execute mpc +cargo run --release --bin compute \ No newline at end of file