Skip to content

Commit

Permalink
Merge pull request #1028 from privacy-scaling-explorations/chore/cli-…
Browse files Browse the repository at this point in the history
…config

chore(cli): change maci-cli script run instructions
  • Loading branch information
0xmad authored Jan 15, 2024
2 parents fb9c747 + c51c34d commit 4e64f8f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 56 deletions.
26 changes: 13 additions & 13 deletions .github/scripts/ceremony-param-tests-c-witness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -e
cd "$(dirname "$0")"
cd ../../cli

HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployVkRegistry -q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js setVerifyingKeys \
node build/ts/index.js deployVkRegistry -q true
node build/ts/index.js setVerifyingKeys \
--state-tree-depth 6 \
--int-state-tree-depth 2 \
--msg-tree-depth 8 \
Expand All @@ -15,8 +15,8 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js setVerifyingKeys
--process-messages-zkey ./zkeys/processMessages_6-8-2-3/processMessages_6-8-2-3.zkey \
--tally-votes-zkey ./zkeys/tallyVotes_6-2-3/tallyVotes_6-2-3.zkey \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js create -s 6 -q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployPoll \
node build/ts/index.js create -s 6 -q true
node build/ts/index.js deployPoll \
-pk macipk.ea638a3366ed91f2e955110888573861f7c0fc0bb5fb8b8dca9cd7a08d7d6b93 \
--duration 300 \
--max-messages 390625 \
Expand All @@ -27,10 +27,10 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployPoll \
--vote-option-tree-depth 3 \
--subsidy-enabled false \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js signup \
node build/ts/index.js signup \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07 \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \
node build/ts/index.js publish \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07 \
--privkey macisk.0ab0281365e01cff60afc62310daec765e590487bf989a7c4986ebc3fd49895e \
--state-index 1 \
Expand All @@ -39,7 +39,7 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \
--nonce 1 \
--poll-id 0 \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \
node build/ts/index.js publish \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07 \
--privkey macisk.0ab0281365e01cff60afc62310daec765e590487bf989a7c4986ebc3fd49895e \
--state-index 1 \
Expand All @@ -48,10 +48,10 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \
--nonce 2 \
--poll-id 0 \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js timeTravel -s 300 -q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js mergeSignups --poll-id 0 -q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js mergeMessages --poll-id 0 -q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js genProofs \
node build/ts/index.js timeTravel -s 300 -q true
node build/ts/index.js mergeSignups --poll-id 0 -q true
node build/ts/index.js mergeMessages --poll-id 0 -q true
node build/ts/index.js genProofs \
--privkey macisk.1751146b59d32e3c0d7426de411218172428263f93b2fc4d981c036047a4d8c0 \
--poll-id 0 \
--rapidsnark ~/rapidsnark/build/prover \
Expand All @@ -64,12 +64,12 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js genProofs \
--process-witnessgen ./zkeys/processMessages_6-8-2-3/processMessages_6-8-2-3_cpp/processMessages_6-8-2-3 \
--process-witnessdat ./zkeys/processMessages_6-8-2-3/processMessages_6-8-2-3_cpp/processMessages_6-8-2-3.dat \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js proveOnChain \
node build/ts/index.js proveOnChain \
--poll-id 0 \
--proof-dir proofs/ \
--subsidy-enabled false \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js verify \
node build/ts/index.js verify \
--poll-id 0 \
--subsidy-enabled false \
--tally-file tally.json \
Expand Down
26 changes: 13 additions & 13 deletions cli/testScript.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
#! /bin/bash
# rm -r ./proofs
# rm tally.json
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployVkRegistry
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js setVerifyingKeys \
node build/ts/index.js deployVkRegistry
node build/ts/index.js setVerifyingKeys \
--state-tree-depth 10 \
--int-state-tree-depth 1 \
--msg-tree-depth 2 \
--vote-option-tree-depth 2 \
--msg-batch-depth 1 \
--process-messages-zkey ./zkeys/ProcessMessages_10-2-1-2_test.0.zkey \
--tally-votes-zkey ./zkeys/TallyVotes_10-1-2_test.0.zkey
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js create -s 10
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployPoll \
node build/ts/index.js create -s 10
node build/ts/index.js deployPoll \
--pubkey macipk.ea638a3366ed91f2e955110888573861f7c0fc0bb5fb8b8dca9cd7a08d7d6b93 \
-t 30 -g 25 -mv 25 -i 1 -m 2 -b 1 -v 2 -se false
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js signup \
node build/ts/index.js signup \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \
node build/ts/index.js publish \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07 \
--privkey macisk.0ab0281365e01cff60afc62310daec765e590487bf989a7c4986ebc3fd49895e \
--state-index 1 \
--vote-option-index 0 \
--new-vote-weight 9 \
--nonce 1 \
--poll-id 0
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \
node build/ts/index.js publish \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07 \
--privkey macisk.0ab0281365e01cff60afc62310daec765e590487bf989a7c4986ebc3fd49895e \
--state-index 1 \
--vote-option-index 1 \
--new-vote-weight 9 \
--nonce 2 \
--poll-id 0
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js timeTravel -s 100
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js mergeSignups --poll-id 0
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js mergeMessages --poll-id 0
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js genProofs \
node build/ts/index.js timeTravel -s 100
node build/ts/index.js mergeSignups --poll-id 0
node build/ts/index.js mergeMessages --poll-id 0
node build/ts/index.js genProofs \
--privkey macisk.1751146b59d32e3c0d7426de411218172428263f93b2fc4d981c036047a4d8c0 \
--poll-id 0 \
--process-zkey ./zkeys/ProcessMessages_10-2-1-2_test.0.zkey \
Expand All @@ -45,11 +45,11 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js genProofs \
-tw ./zkeys/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm \
-pw ./zkeys/ProcessMessages_10-2-1-2_test_js/ProcessMessages_10-2-1-2_test.wasm \
-w true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js proveOnChain \
node build/ts/index.js proveOnChain \
--poll-id 0 \
--proof-dir proofs/ \
--subsidy-enabled false
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js verify \
node build/ts/index.js verify \
--poll-id 0 \
--subsidy-enabled false \
--tally-file tally.json
29 changes: 0 additions & 29 deletions website/versioned_docs/version-v1.x/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ contracts can refer to the same VkRegistry as long as they are all owned (via
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js deployVkRegistry
```

Expand All @@ -96,7 +95,6 @@ TallyVotes_<STATE_TREE_DEPTH>-<INT_STATE_TREE_DEPTH>-<VOTE_OPTION_TREE_DEPTH>>_t
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js setVerifyingKeys \
-s 10 -i 1 -m 2 -v 2 -b 1 \
-p ./zkeys/ProcessMessages_10-2-1-2_test/ProcessMessages_10-2-1-2_test.0.zkey \
Expand All @@ -116,7 +114,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js create -s 10
```

Expand All @@ -131,7 +128,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node ./build/index.js deployPoll \
-pk macipk.c974f4f168b79727ac98bfd53a65ea0b4e45dc2552fe73df9f8b51ebb0930330 \
-t 30 -g 25 -mv 25 -i 1 -m 2 -b 1 -v 2
Expand All @@ -152,7 +148,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node ./build/index.js signup \
-p macipk.c974f4f168b79727ac98bfd53a65ea0b4e45dc2552fe73df9f8b51ebb0930330
```
Expand All @@ -169,7 +164,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js publish \
-p macipk.c974f4f168b79727ac98bfd53a65ea0b4e45dc2552fe73df9f8b51ebb0930330 \
-sk macisk.2ae4f199bf3925a2407f7c775c9261f351ab861d8e9ecbb84622bdd3f6d41b08 \
Expand All @@ -188,7 +182,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js timeTravel -s 1000
```

Expand All @@ -203,7 +196,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js mergeSignups -o 0
```

Expand All @@ -224,7 +216,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js mergeMessages -o 0
```

Expand All @@ -246,7 +237,6 @@ Example output:
Example usage to generate the state locally from the smart contracts events:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js genLocalState \
--poll-id 0 \
--output localState.json \
Expand All @@ -268,7 +258,6 @@ Example usage:
**C++ witness parameters**

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js genProofs -x 0x89962fa216d39fCcaaC11e1e462340d80ab6Cf4D \
-sk macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \
-o 0 \
Expand All @@ -284,7 +273,6 @@ node build/ts/index.js genProofs -x 0x89962fa216d39fCcaaC11e1e462340d80ab6Cf4D \
**WASM Parameters**

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js genProofs \
-sk macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \
-o 0 \
Expand Down Expand Up @@ -318,7 +306,6 @@ Example usage to generate the proofs locally from the local state file created w
**C++ witness parameters**

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js genProofs \
--privkey macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \
--poll-id 0 \
Expand All @@ -335,7 +322,6 @@ node build/ts/index.js genProofs \
**WASM Params**

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js genProofs \
--privkey macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \
--poll-id 0 \
Expand Down Expand Up @@ -367,7 +353,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js proveOnChain \
-o 0 \
-f proofs/
Expand All @@ -391,7 +376,6 @@ Example output:
Example usage:

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js verify \
-o 0 \
-t tally.json
Expand Down Expand Up @@ -433,7 +417,6 @@ Public key: macipk.3e7bb2d7f0a1b7e980f1b6f363d1e3b7a12b9ae354c2cd60a9cfa9fd1291
### Coordinator: Deploy VkRegistry

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js deployVkRegistry
```

Expand All @@ -446,7 +429,6 @@ Output:
### Coordinator: Set verifying keys

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js setVerifyingKeys \
--state-tree-depth 10 \
--int-state-tree-depth 1 \
Expand All @@ -468,7 +450,6 @@ Output:
### Coordinator: Create MACI instance

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js create -s 10
```

Expand All @@ -481,7 +462,6 @@ Output:
### Coordinator: Deploy poll

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node ./build/index.js deployPoll \
-pk macipk.c974f4f168b79727ac98bfd53a65ea0b4e45dc2552fe73df9f8b51ebb0930330 \
-t 1000 -g 25 -mv 25 -i 1 -m 2 -b 1 -v 2
Expand All @@ -500,7 +480,6 @@ Output:
### Alice: sign up

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node ./build/index.js signup \
--pubkey macipk.3e7bb2d7f0a1b7e980f1b6f363d1e3b7a12b9ae354c2cd60a9cfa9fd12917391
```
Expand All @@ -515,7 +494,6 @@ Output:
### Alice: votes for Party A (option index 0)

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js publish \
--pubkey macipk.3e7bb2d7f0a1b7e980f1b6f363d1e3b7a12b9ae354c2cd60a9cfa9fd12917391 \
--privkey macisk.fd7aa614ec4a82716ffc219c24fd7e7b52a2b63b5afb17e81c22fe21515539c \
Expand All @@ -536,7 +514,6 @@ Output:
### Alice: submits an invalid vote for Party B (option index 1) with different public key

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js publish \
--pubkey macipk.d5788ea6ccf1ec295df99aaef859031fe7bd359e7e03acb80eb6e8a192f2ce19 \
--privkey macisk.fd7aa614ec4a82716ffc219c24fd7e7b52a2b63b5afb17e81c22fe21515539c \
Expand All @@ -557,7 +534,6 @@ Output:
### Coordinator: Time Travel

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js timeTravel -s 1000
```

Expand All @@ -570,7 +546,6 @@ Output:
### Coordinator: merge state tree

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js mergeSignups --poll-id 0
```

Expand All @@ -589,7 +564,6 @@ Output:
### Coordinator: merge message tree

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js mergeMessages --poll-id 0
```

Expand All @@ -609,7 +583,6 @@ Output:
### Coordinator: generate proofs

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js genProofs \
--privkey macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \
--poll-id 0 \
Expand Down Expand Up @@ -638,7 +611,6 @@ Output:
### Coordinator: prove on chain

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js proveOnChain \
--poll-id 0 \
--proof-dir proofs/
Expand All @@ -660,7 +632,6 @@ Output:
### Anyone: verify

```bash
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js verify \
--poll-id 0 \
--tally-file tally.json
Expand Down
1 change: 0 additions & 1 deletion website/versioned_docs/version-v1.x/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ sidebar_position: 17
If your logs look like the following, then make sure you have `ProcessMessages_10-2-1-2_test.dat` and `TallyVotes_10-1-2_test.dat` files in the same directory as your zkeys:

```
HARDHAT_CONFIG=./build/hardhat.config.js \
node build/ts/index.js genProofs -x 0xf204a4Ef082f5c04bB89F7D5E6568B796096735a \
> -sk macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \
> -o 0 \
Expand Down

0 comments on commit 4e64f8f

Please sign in to comment.