From f4124362725aadc07dce0bc59e29c9dcf357398c Mon Sep 17 00:00:00 2001 From: Akilesh Tangella Date: Wed, 14 Jun 2023 13:22:34 -0400 Subject: [PATCH] cli-demo folder --- README.md | 26 ++++++++++----------- {demo => cli-demo}/alice_private_key.txt | 0 {demo => cli-demo}/bob_private_key.txt | 0 {demo => cli-demo}/carol_private_key.txt | 0 {demo => cli-demo}/committee_file_demo.json | 0 {demo => cli-demo}/signer_private_key.txt | 0 6 files changed, 13 insertions(+), 13 deletions(-) rename {demo => cli-demo}/alice_private_key.txt (100%) rename {demo => cli-demo}/bob_private_key.txt (100%) rename {demo => cli-demo}/carol_private_key.txt (100%) rename {demo => cli-demo}/committee_file_demo.json (100%) rename {demo => cli-demo}/signer_private_key.txt (100%) diff --git a/README.md b/README.md index e269207..0bd146a 100644 --- a/README.md +++ b/README.md @@ -49,21 +49,21 @@ KEYFILE_PASSWORD = abc123 Create 4 keyfiles with the following commands: ```sh -yarn ts-node scripts/encrypt_private_key.ts ./demo/signer_private_key.txt -p abc123 -k signer.keyfile.json +yarn ts-node scripts/encrypt_private_key.ts ./cli-demo/signer_private_key.txt -p abc123 -k ./cli-demo/signer.keyfile.json -yarn ts-node scripts/encrypt_private_key.ts ./demo/alice_private_key.txt -p abc123 -k alice.keyfile.json +yarn ts-node scripts/encrypt_private_key.ts ./cli-demo/alice_private_key.txt -p abc123 -k ./cli-demo/alice.keyfile.json -yarn ts-node scripts/encrypt_private_key.ts ./demo/bob_private_key.txt -p abc123 -k bob.keyfile.json +yarn ts-node scripts/encrypt_private_key.ts ./cli-demo/bob_private_key.txt -p abc123 -k ./cli-demo/bob.keyfile.json -yarn ts-node scripts/encrypt_private_key.ts ./demo/carol_private_key.txt -p abc123 -k carol.keyfile.json +yarn ts-node scripts/encrypt_private_key.ts ./cli-demo/carol_private_key.txt -p abc123 -k ./cli-demo/carol.keyfile.json ``` Deploy the contracts and write the configuration to files `nouns.config.json`, `zkv.config.json`, `dkg.config.json`. These files are read by later commands to connect to the contract. ```console -$ yarn ts-node scripts/deploy_dkg_zkvote.ts signer.keyfile.json ./demo/committee_file_demo.json -$ yarn ts-node scripts/deploy_dummy_nouns.ts signer.keyfile.json +$ yarn ts-node scripts/deploy_dkg_zkvote.ts ./cli-demo/signer.keyfile.json ./cli-demo/committee_file_demo.json +$ yarn ts-node scripts/deploy_dummy_nouns.ts ./cli-demo/signer.keyfile.json ``` Launch 3 committee daemons (each in it's own terminal, as the process will not @@ -71,29 +71,29 @@ terminate until votes are tallied). For demo purposes, we set the tally to be triggered when the total voting weight reaches 10. Alternatively, it can be run with no `-v` flag and only committee member number parameter. In this case, tally will trigger when `endBlock` is reached. ```sh -yarn ts-node scripts/committee.ts alice.keyfile.json -v 10 +yarn ts-node scripts/committee.ts ./cli-demo/alice.keyfile.json -v 10 ``` ```sh -yarn ts-node scripts/committee.ts bob.keyfile.json -v 10 +yarn ts-node scripts/committee.ts ./cli-demo/bob.keyfile.json -v 10 ``` ```sh -yarn ts-node scripts/committee.ts carol.keyfile.json -v 10 +yarn ts-node scripts/committee.ts ./cli-demo/carol.keyfile.json -v 10 ``` In a new terminal, setup a vote with proposal Id 1 and end block 1234, register some dummy voters and cast votes up to a total voting weight above 10 (max total voting weight is 20). For example: ```sh -yarn ts-node scripts/setup_vote.ts 1 1234 signer.keyfile.json +yarn ts-node scripts/setup_vote.ts 1 1234 ./cli-demo/signer.keyfile.json ``` ```sh -yarn ts-node scripts/vote.ts 1 yay 6 alice.keyfile.json +yarn ts-node scripts/vote.ts 1 yay 6 ./cli-demo/alice.keyfile.json ``` ```sh -yarn ts-node scripts/vote.ts 1 nay 3 bob.keyfile.json +yarn ts-node scripts/vote.ts 1 nay 3 ./cli-demo/bob.keyfile.json ``` ```sh -yarn ts-node scripts/vote.ts 1 yay 5 carol.keyfile.json +yarn ts-node scripts/vote.ts 1 yay 5 ./cli-demo/carol.keyfile.json ``` When the committee commands notice that the total voting weight used is at diff --git a/demo/alice_private_key.txt b/cli-demo/alice_private_key.txt similarity index 100% rename from demo/alice_private_key.txt rename to cli-demo/alice_private_key.txt diff --git a/demo/bob_private_key.txt b/cli-demo/bob_private_key.txt similarity index 100% rename from demo/bob_private_key.txt rename to cli-demo/bob_private_key.txt diff --git a/demo/carol_private_key.txt b/cli-demo/carol_private_key.txt similarity index 100% rename from demo/carol_private_key.txt rename to cli-demo/carol_private_key.txt diff --git a/demo/committee_file_demo.json b/cli-demo/committee_file_demo.json similarity index 100% rename from demo/committee_file_demo.json rename to cli-demo/committee_file_demo.json diff --git a/demo/signer_private_key.txt b/cli-demo/signer_private_key.txt similarity index 100% rename from demo/signer_private_key.txt rename to cli-demo/signer_private_key.txt