forked from privacy-scaling-explorations/maci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·32 lines (24 loc) · 878 Bytes
/
test.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
#!/bin/bash
function copy_tally() {
CONTAINER_ID=$(docker container ls | grep maci-node | cut -d' ' -f1)
docker cp $1 $CONTAINER_ID:/root/maci/cli/
}
# 1. admin deploy contracts and store info into database
./admin.sh deploy
./admin.sh store
# 2. user signup & publish messages
pk=macipk.d49f1ed2fd22ca7e3bf96a5d3bcf245e6b440fc77cfa360ae50ff7b67990fb1e
sk=macisk.27281729e0ece51695bd064eeb4215da20498e19bd4eeab75f83b99ed80226b5
maci=0xf204a4Ef082f5c04bB89F7D5E6568B796096735a
./user.sh signup -p $pk -x $maci
./user.sh publish -p $pk -x $maci -sk $sk -i 1 -v 0 -w 9 -n 1 -o 0
DirName=$(dirname $0)
tally_file=$DirName/../cli/tally.json
prove_file=$DirName/../cli/proofs.json
rm -f $tally_file $prove_file
# 3. admin prove and submit on-chain
./admin.sh process
# 4. user verify proof
pid=0
copy_tally $tally_file
./user.sh verify -t $tally_file -x $maci -o $pid