From c51c34dc915721770474ad3555853ce1264aea07 Mon Sep 17 00:00:00 2001 From: 0xmad <0xmad@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:41:41 -0600 Subject: [PATCH] chore(cli): change maci-cli script run instructions --- .../scripts/ceremony-param-tests-c-witness.sh | 26 ++++++++--------- cli/testScript.sh | 26 ++++++++--------- website/versioned_docs/version-v1.x/cli.md | 29 ------------------- .../version-v1.x/troubleshooting.md | 1 - 4 files changed, 26 insertions(+), 56 deletions(-) mode change 100644 => 100755 cli/testScript.sh diff --git a/.github/scripts/ceremony-param-tests-c-witness.sh b/.github/scripts/ceremony-param-tests-c-witness.sh index 79fdf7c590..b4c4015f03 100755 --- a/.github/scripts/ceremony-param-tests-c-witness.sh +++ b/.github/scripts/ceremony-param-tests-c-witness.sh @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ diff --git a/cli/testScript.sh b/cli/testScript.sh old mode 100644 new mode 100755 index 21281319ea..96ad884273 --- a/cli/testScript.sh +++ b/cli/testScript.sh @@ -1,8 +1,8 @@ #! /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 \ @@ -10,13 +10,13 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js setVerifyingKeys --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 \ @@ -24,7 +24,7 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \ --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 \ @@ -32,10 +32,10 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \ --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 \ @@ -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 diff --git a/website/versioned_docs/version-v1.x/cli.md b/website/versioned_docs/version-v1.x/cli.md index c1a60012e2..6c6755ae26 100644 --- a/website/versioned_docs/version-v1.x/cli.md +++ b/website/versioned_docs/version-v1.x/cli.md @@ -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 ``` @@ -96,7 +95,6 @@ TallyVotes_-->_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 \ @@ -116,7 +114,6 @@ Example output: Example usage: ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node build/ts/index.js create -s 10 ``` @@ -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 @@ -152,7 +148,6 @@ Example output: Example usage: ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node ./build/index.js signup \ -p macipk.c974f4f168b79727ac98bfd53a65ea0b4e45dc2552fe73df9f8b51ebb0930330 ``` @@ -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 \ @@ -188,7 +182,6 @@ Example output: Example usage: ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node build/ts/index.js timeTravel -s 1000 ``` @@ -203,7 +196,6 @@ Example output: Example usage: ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node build/ts/index.js mergeSignups -o 0 ``` @@ -224,7 +216,6 @@ Example output: Example usage: ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node build/ts/index.js mergeMessages -o 0 ``` @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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/ @@ -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 @@ -433,7 +417,6 @@ Public key: macipk.3e7bb2d7f0a1b7e980f1b6f363d1e3b7a12b9ae354c2cd60a9cfa9fd1291 ### Coordinator: Deploy VkRegistry ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node build/ts/index.js deployVkRegistry ``` @@ -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 \ @@ -468,7 +450,6 @@ Output: ### Coordinator: Create MACI instance ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node build/ts/index.js create -s 10 ``` @@ -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 @@ -500,7 +480,6 @@ Output: ### Alice: sign up ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node ./build/index.js signup \ --pubkey macipk.3e7bb2d7f0a1b7e980f1b6f363d1e3b7a12b9ae354c2cd60a9cfa9fd12917391 ``` @@ -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 \ @@ -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 \ @@ -557,7 +534,6 @@ Output: ### Coordinator: Time Travel ```bash -HARDHAT_CONFIG=./build/hardhat.config.js \ node build/ts/index.js timeTravel -s 1000 ``` @@ -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 ``` @@ -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 ``` @@ -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 \ @@ -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/ @@ -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 diff --git a/website/versioned_docs/version-v1.x/troubleshooting.md b/website/versioned_docs/version-v1.x/troubleshooting.md index f759a4aa93..d2168c978d 100644 --- a/website/versioned_docs/version-v1.x/troubleshooting.md +++ b/website/versioned_docs/version-v1.x/troubleshooting.md @@ -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 \