Skip to content

Commit 10eeaba

Browse files
authored
Merge pull request #1259 from Concordium/Update-Election-coordinator-tool-page
Updated Election coordinator tool
2 parents b466535 + 9032fb6 commit 10eeaba

File tree

1 file changed

+18
-98
lines changed

1 file changed

+18
-98
lines changed

source/mainnet/docs/voting/coordinator.rst

Lines changed: 18 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -7,119 +7,39 @@ Election coordinator tool
77

88
The coordinator tool is an administrative tool to coordinate the parts of the election that are not done by voters or guardians.
99

10-
The coordinator of the election is not trusted per se. All the actions it can do can be verified by any other party. The coordinator tool can be mostly run without access to any secrets to verify results of the election. However some commands take "admin keys" where the result of operations can be posted in the contract for everybody to see. If such a result is present in the contract and another user runs the coordinator tool, the tool will check that the result it computed and the one posted in the contract agree.
10+
The coordinator of the election is not trusted per se. :ref:`All the actions it can do can be verified by any other party<verify-election-result>`. The coordinator tool can mostly run without access to any secrets to verify election results. However, some commands take ``admin keys`` where the result of operations can be posted in the contract for everybody to see. If such a result is present in the contract and another user runs the coordinator tool, the tool will check that the result it computed and the one posted in the contract agree.
1111

1212
Build and run
1313
=============
1414

15-
To build the tool make sure you have the repository submodules initialized:
15+
To build the election coordinator tool, you need:
1616

17-
.. code-block:: console
18-
19-
git submodule update --init --recursive
20-
21-
Build the tool by running:
22-
23-
.. code-block:: console
24-
25-
cargo build --release
26-
27-
This will produce a single binary election-coordinator in target/release directory.
28-
29-
Commands
30-
========
31-
32-
The tool has the following subcommands. All commands have a ``--help`` option which explains the input and output parameters.
33-
34-
Get the list of initial weights
35-
-------------------------------
36-
37-
Use the ``initial-weights generate`` command to gather the average amount of CCD on an account in the given period. The intention is that this command is used to produce the initial weights of each account prior to the election starting. The output of this command is a CSV file used in the ``final-weights`` command after the election.
17+
* Rust 1.74 or newer
18+
* The repository with initialized submodules
3819

39-
Example
20+
First, initialize the repository submodules:
4021

4122
.. code-block:: console
4223
43-
election-coordinator --node http://localhost:20001 initial-weights --out . generate --start 2024-01-01T00:00:00Z --end 2024-01-03T00:00:00Z
44-
45-
The weights are stored in the initial-weights.csv file, and the corresponding parameters used to compute them are stored in initial-weights-params.json file in the current path directory.
46-
47-
Create a new election instance
48-
------------------------------
49-
50-
Use the ``new-election`` command to create the necessary files and the contract for a new election. In particular it will:
51-
52-
- create an election manifest based on the inputs
53-
54-
- create election parameters based on the inputs
55-
56-
- create a new smart contract instance.
57-
58-
.. code-block:: console
59-
60-
election-coordinator new-election --module ../contracts/concordium-governance-committee-election/concordium-out/module.wasm.v1 --threshold 1 --admin ../test-scripts/keys/2yJxX711aDXtit7zMu7PHqUMbtwQ8zm7emaikg24uyZtvLTysj.export --election-start '2024-02-01T00:00:00Z' --election-end '2024-02-07T00:00:00Z' --decryption-deadline '2024-02-08T00:00:00Z' --delegation-string 'delegatevote2024' --out election --voters-file initial-weights.csv --voters-params-file initial-weights-params.json --guardian 31bTNa42u1zZWag2bknEy7VraeJUozXsJMN1DFjQp7E5YR6a3G --guardian 4PF6BH8bKvM48b8KNYdvGW6Sv3B2nqVRiMnWTj9cvaNHJQeX3D --candidate candidate1.json --candidate https://some.url/candidate2.json --node 'https://grpc.testnet.concordium.com:20000' --base-url https://gcvoting.testnet.concordium.com`
61-
62-
The options are:
63-
64-
``--admin`` is the path to the keys that will be used to create the contract, and serve as the admin
65-
66-
``--module`` is the path to the compiled election smart contract in wasm.v1 format
67-
68-
``--threshold`` is the threshold for the number of guardians needed for decryption of the result of the election
69-
70-
``--election-start`` and ``--election-end`` date and time for election start and end
71-
72-
``decryption-deadline`` is the date and time by which guardians must have decrypted their share of the votes
73-
74-
``--delegation-string`` is the string that will be used to determine vote delegations. This is the string users delegating a vote in a wallet must enter in a transaction memo.
75-
76-
``--voters-file`` is the initial-weights.csv file for the election
77-
78-
``--voters-params-file`` is the initial-weights-params.json file for the election, containing the params used to compute the initial weights.
79-
80-
``--guardian`` (repeated) is guardian account addresses. At least one is needed.
81-
82-
``--candidate`` (repeated) is a URL or a path to a candidate. The order here matters, since that will be the order of selections in the election. The link is to the candidate metadata. The hash of the metadata will be embedded in the contract.
83-
84-
``--base-url`` the URL where the election server is accessible, e.g., https://gcvoting.testnet.concordium.com
85-
86-
The tool generates three things:
87-
88-
- An election manifest and election parameters which are written to the directory specified by ``--out``
89-
90-
- A new smart contract instance which is printed to stderr, for example, ``Deployed new contract instance with address <7838,0> using transaction hash 3b3e61a01fd3ecefddecbe6760c6ba3d951f4d0a8947d63990ffe9219249de27``.
91-
92-
Get the final weights
93-
---------------------
94-
95-
Use the ``final-weights`` command to compute the final weights taking into account the delegation. It takes initial weights in the initial-weights.csv into account and any delegations during the election period, outputting the result to final-weights.csv. The output of this command is used in the tally command.
96-
97-
Example
98-
99-
.. code-block:: console
100-
101-
election-coordinator --node http://localhost:20001 final-weights --contract '<7795,0>' --initial-weights initial-weights.csv --final-weights final-weights.csv
102-
103-
Tally the votes and register the encrypted tally in the contract
104-
----------------------------------------------------------------
24+
git submodule update --init --recursive
10525
106-
The ``tally`` command uses the final-weights.csv generated above to compute the encrypted tally of the election and optionally post it in the smart contract. This sums up all the votes during the election period and scales them according to the specified weights.
26+
Then, build the tool:
10727

10828
.. code-block:: console
10929
110-
election-coordinator --node http://localhost:20001 tally --contract '<7795,0>' --final-weights final-weights.csv --admin-keys ../test-scripts/keys/2yJxX711aDXtit7zMu7PHqUMbtwQ8zm7emaikg24uyZtvLTysj.export
111-
112-
The same command without the ``--admin-keys`` option will tally the votes and check that the tally matches what is registered in the contract.
113-
114-
Decrypt the final result
115-
------------------------
30+
cargo build --release
11631
117-
Use the ``final-result`` command after the guardians have each decrypted their share of the encrypted tally. This command can be used to combine the shares and post the result in the contract, or if the result is already posted, to check that it matches what you compute.
32+
This will produce a single binary election-coordinator in the target/release directory.
11833

119-
.. code-block:: console
34+
Use the tool
35+
============
12036

121-
election-coordinator --node http://localhost:20001 final-result --contract '<7795,0>' --admin-keys ../test-scripts/keys/2yJxX711aDXtit7zMu7PHqUMbtwQ8zm7emaikg24uyZtvLTysj.export```
37+
The election coordinator tool helps manage the election process through various commands. The key functionality includes:
12238

123-
This will look up all the decryption shares provided by the guardians, check that they are valid, and if there are enough of the valid ones, it will decrypt the final result and publish it in the smart contract.
39+
* Managing voting weights (initial and final calculations)
40+
* Setting up and configuring new elections
41+
* Processing vote tallies
42+
* Handling guardian operations
43+
* Publishing final results
12444

125-
If the ``admin-keys`` are not provided the command will do everything else as with the keys, except it will check if the result in the contract matches or not, and report the result.
45+
For a complete list of commands, their parameters, and usage examples, see the `coordinator-tool documentation <https://github.com/Concordium/concordium-governance-committee-voting/tree/main/coordinator-tool>`_.

0 commit comments

Comments
 (0)