diff --git a/scripts/tally/Readme.md b/scripts/tally/Readme.md new file mode 100644 index 0000000000..69a24734a6 --- /dev/null +++ b/scripts/tally/Readme.md @@ -0,0 +1,8 @@ +# How to use tally script +### Offline +To run the offline tally script we need the committe key and the `active_plans.json` (voteplans encrypted file) to be in the folder where the script is executed. The committee key is generated by the vitup tool together with the other backend artifacts, the `active_plans.json` can be retrived from the api with `curl https://{url}/api/v0/vote/active/plans > active_plans.json` after vote ended. Also we need the jcli tool to be installed. We can then run the script passing the voteplan id of the voteplan we want to decrypt `./private_offline.sh 9a278b6f788278e5cd8dfd6de8b8b8699a7f6b4847c680843de6c02d5b3169b2` + + +### Online +To run the online tally script we need the committe key to be in the folder where the script is executed. We need to set the env variable `JORMUNGANDR_RESTAPI_URL` in the script. Also we need the jcli tool to be installed. We can then run the script passing the voteplan index of the voteplan we want to decrypt and the expiry block date. The expiry block date is obtained taking the field `"lastBlockDate"` from the response of `https://{url}/api/v0/node/stats` and rounding that up. So if `"lastBlockDate": "25.779"` the script would be called like `./private.sh 0 26.0` +The online tally script needs to be runned after voting ends and before tally time ends. The script will post the decrypted result back to the node as a transaction and it will appear in the `https://{url}/api/v0/vote/active/plans`