-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrun-proving.sh
executable file
·47 lines (41 loc) · 1.57 KB
/
run-proving.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
if [ $# -lt 1 ]; then
echo "usage: ./run_proving revme or sha2-rust or sha2-go or mem-alloc-vec"
exit 1
fi
set -e
program=$1
BASEDIR=$(cd $(dirname $0); pwd)
export ZKM_PROVER=local
#export ZKM_PROVER=network
export LD_LIBRARY_PATH=$BASEDIR/../sdk/src/local/libsnark:$LD_LIBRARY_PATH ##Modify it according your template
export RUST_LOG=info
export SEG_SIZE=262144
export ARGS="711e9609339e92b03ddc0a211827dba421f38f9ed8b9d806e1ffdd8c15ffa03d world!"
export JSON_PATH=${BASEDIR}/test-vectors/test.json
export PROOF_RESULTS_PATH=${BASEDIR}/../contracts
export EXECUTE_ONLY=false
export VERIFYING_KEY_PATH=${BASEDIR}/../contracts/src
export SETUP_FLAG=false
##network proving
export CA_CERT_PATH=${BASEDIR}/tool/ca.pem
export PROOF_NETWORK_PRVKEY= ##The private key corresponding to the public key when registering in the https://www.zkm.io/apply
export ENDPOINT=https://152.32.186.45:20002 ##the test entry of zkm proof network
export DOMAIN_NAME=stage
echo "Compile guest-program ${program}"
if [[ "$program" =~ .*go$ ]];then
cd $BASEDIR/../guest-program/$program
GOOS=linux GOARCH=mips GOMIPS=softfloat go build -o $program
cd -
fi
if [ "$program" == "sha2-rust" ];then
export SEG_SIZE=65536
elif [ "$program" == "mem-alloc-vec" ];then
export SEG_SIZE=65536
elif [ "$program" == "sha2-precompile" ];then
export SEG_SIZE=16384
fi
echo "SEG_SIZE:$SEG_SIZE"
echo "BASEDIR:$BASEDIR"
echo "ZKM_PROVER:$ZKM_PROVER"
nohup $BASEDIR/../target/release/$program >./$program-$ZKM_PROVER-proving.log 2>&1 &
echo "Check out the log: tail -f $program-$ZKM_PROVER-proving.log"