Contains ZoKrates Benchmark scripts, related code and documentation
Subsequently, we explain how to benchmark ZoKrates on a remote server to which we have ssh
access
Assumptions for now:
- Git, Jupyter Notebook are installed
- The description below is written for a specific ISE Linux Server. Adjust commands for other machines.
TODO: remove zokrates_unoptimized binary, as this is a mac-os executable for now and we want this to be more flexible.
- Connect to TU VPN
- Connect to server
ssh je@kbl.ise.tu-berlin.de
- Start Benchmarking Jupyter Notebook so that it doesn't quit when ssh session ends
cd ~/ZoKratesBenchmarks nohup jupyter-notebook --ip=kabylake.ise.tu-berlin.de --no-browser &
- Copy the login
token
that is printed to the console as URL querystring for the notebook. Example output:http://kabylake.ise.tu-berlin.de:8888/?token=a1897d2f34b3db7e4c0b82fed5ee65552dad3ccff4b89793
-
While connect to TU VPN
-
In a new terminal window, setup SSH Tunnel
ssh -N -p 22 je@kbl.ise.tu-berlin.de -L 127.0.0.1:8889:kbl.ise.tu-berlin.de:8888
-
Open Browser on localhost and access remote Juypter Notebook at:
Use Jupyter Notebook UI
Copy results from remote server to localhost:
scp -r je@kbl.ise.tu-berlin.de:~/ZoKratesBenchmarks/exports
~/Desktop/ZoKratesRemoteBenchmark/exports
-
Make sure you're in the home directory
cd ~/
-
Install ZoKrates
curl -LSfs get.zokrat.es | sh
-
Set environment variables in ~/.bashrc
export PATH=$PATH:$HOME/.zokrates/bin export ZOKRATES_HOME=$HOME/.zokrates/stdlib
-
Update stdlib to contain mimc (PR not merged yet)
git clone https://github.com/petscheit/ZoKrates.git cd ZoKrates git checkout mimc_sponge
and then move
stlib
to the right placecp -r zokrates_stdlib/stdlib/ ~/.zokrates/stdlib/
-
Setup Benchmarking Juypter Notebook
- Clone directly from Github (when it becomes public)
cd ~/ git clone https://github.com/JacobEberhardt/ZoKratesBenchmarks.git
- Clone locally and copy from localhost to remote
scp -r ZoKratesBenchmarks/ je@kbl.ise.tu-berlin.de:~/ZoKratesBenchmarks
-
Install Rust nightly through rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
and add nightly toolchain:
rustup toolchain install nightly
Then, make it default:
rustup default nightly
-
Build unoptimized ZoKrates
- Clone branch from github
cd ~/ git clone -b benchmarks/unoptimized https://github.com/Zokrates/ZoKrates.git ZoKratesUnoptimized cargo +nightly build --release
- Build release version with nightly rust
cd ~/ZoKratesUnoptimized cargo +nightly build --release
- Copy executable to user bin directory.
Make sure it's in path by adding to
cp ~/ZoKratesUnoptimized/target/release/zokrates ~/bin/zokrates_unoptimized
~/.bashrc
export PATH=$PATH:$HOME/bin
- Clone branch from github
-
Install stable version of the Go Ethereum client
geth
:sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get update sudo apt-get install ethereum
-
Install stable version of the Solidity Compiler
solc
:npm i -g solc