Skip to content

Commit

Permalink
added the finalization scripts also in the maci-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
yashgo0018 committed Sep 21, 2024
1 parent fa5437a commit 1434aae
Show file tree
Hide file tree
Showing 8 changed files with 819 additions and 97 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,9 @@ yarn start

7. **Compute Results**

- In a fourth terminal, clone the maci repo - `git clone [email protected]:privacy-scaling-explorations/maci.git`
- Copy the zkeys generated from the maci wrapper repo to the cli directory of the maci repo using `cp -r maci-wrapper/packages/hardhat/zkeys maci/packages/cli`.
- Install the dependencies using `pnpm i` and build the maci project using `pnpm run build`
- Copy the new contract addresses from the maci wrapper repo to the maci repo using `cp -r maci-wrapper/packages/hardhat/contractAddresses.json maci/packages/cli/build/contractAddresses.json`. You can also copy the `deployed-contracts.json`file from the maci wrapper repo to the maci repo `cp maci-wrapper/packages/hardhat/deployed-contracts.json maci/packages/contracts/deployed-contracts.json`.
- Inside the MACI repo folder, run `cp packages/contracts/deploy-config-example.json packages/contracts/deploy-config.json`
- After this you should be able to run the commands written in the [maci documentation](https://maci.pse.dev/docs/quick-start/poll-finalization).
- First merge signups, then merge messages, and then generate proof, and upload the tally.json file which is generated in the process to the admin panel after the poll is over.
- Update `packages/hardhat/deploy-config.json` file, select the network, and in the `Poll` object, update `coordinatorPubkey` to the coordinator public key in the `packages/hardhat/coordinatorKeyPair.json`, and update `useQuadraticVoting` if you want to compute results for a non quadratic vote.
- Merge the poll, using `yarn hardhat merge --poll {poll id}`
- Generate proof, using `yarn hardhat prove --poll {poll id} --output-dir {proof ouput dir} --coordinator-private-key {coordinator private key} --tally-file {tally output file}`

Navigate to `http://localhost:3000` to interact with your dApp. Modify your app configuration in `packages/nextjs/scaffold.config.ts` and `packages/hardhat/constants.ts` as necessary.

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"precommit": "lint-staged",
"vercel": "yarn workspace @se-2/nextjs vercel",
"vercel:yolo": "yarn workspace @se-2/nextjs vercel:yolo",
"download-zkeys": "yarn workspace @se-2/hardhat download-zkeys"
"download-zkeys": "yarn workspace @se-2/hardhat download-zkeys",
"hardhat": "yarn workspace @se-2/hardhat hardhat"
},
"packageManager": "[email protected]",
"devDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion packages/hardhat/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ deployments/localhost

zkeys
coordinatorKeyPair.json
contractAddresses.json
contractAddresses.json

proof
tally.json
Loading

0 comments on commit 1434aae

Please sign in to comment.