Skip to content

Tonexus/block-ballot

Repository files navigation

Before running you will need python3 installed as well as installing all packages in requirements.txt.

  • Note it is 11:45 and we did not record well all the required libraries and hopefully they are all in there.

Below we will provide documentation on how to run our tests on our system.

The first and easiest is to run a tester file which starts up the nodes and issuers in different processes.

python3 tester.py -c tester_config.json

We have another script which you can manually start up the nodes and processors but it mocks a simple election and prints the entire blockchain afterwards.

Run the following commands each in a separate terminal

python3 run_issuer.py -c config.json python3 run_processor.py -c config.json -i 0 python3 run_processor.py -c config.json -i 1 python3 run_processor.py -c config.json -i 2

Then after a few seconds to allow these to start up run the following script

python3 client.py

This will register users with the Issuer, then have them vote for one of two people at random. The results should be obvious to interpret. The resulting blockchain if you wish to inspect it will be written to a file called blockchain.json

To start the Issuer

python3 run_issuer.py -c

To run a processor

python3 run_processor.py -c -i

Config file json

{ "issuer_config": {"num_zeros": 2, "transactions_per_block": 3}, "processor_config": { "initblockchain" : "None", "voters_map" : {}, "config": { "issuer_address": "https://localhost:12345/ISSUER" } }, "nodes": ["http://localhost:30001/PROCESSOR"], "node_ports": [30001]

}

issuer_config - dict sent to the issuer on start up. Currently number of zeros for POW and transactions per block. processor_config - contains the issuer address and an initblockchain. Currently will not change Can have either of the below nodes - list of nodes used if node_ports not set node_ports - list of ports for the processors to be listening to to generate nodes list all on localhost

Above is all used in the script setup.sh along with run_issuer.py and run_processor.py files

To kill all the processes locally use ./kill.sh

All Errors and regular print output go to their files in logs. It is just a running total.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published