A voting system that leverages the blockchain to deliver secure and transparent ballots.
The following guide serves to get anyone started in contributing to Jamii Ballots.
The following need to be installed;
Brownie - a python-based development and testing framework for smart contracts that target the EVM.
Ganache CLI - a personal blockchain for rapid Ethereum decentralized application development.
Make sure to have a ESlint and Prettier plugins are installed to check for code-smells and auto-formatting.
git clone https://github.com/lumunge/Jamii_Blockchain_Voting.git
$ brownie networks add Ethereum ganache-local host=http://127.0.0.1:7545 chainid=5777
$ ganache-cli
First, we can delete the pre-existing contract ABIs and have a new fresh deployment to mess with. For this we delete the build folder in the project root directory and the build folder located in the client/build directory. If you cloned the project, then the former should NOT exist.
$ rm -rf build client/build
Paste the following in the .env file;
PRIVATE_KEY_1="super secret private key
KOVAN_INFURA_URL="secret kovan infura url"
RINKEBY_INFURA_URL="secret rinkeby infura url"
GOERLI_INFURA_URL="secret goerli infura url"
We can get url + keys from infura
PRIVATE_KEY_1 is the private key obtained from a meta mask wallet. It is the key that will sign the transactions to deploy the contract. It should have enough Goerli, Kovan, or Rinkaby test Eth(funds) to deploy the contract. This should be kept secure and private in the .env file which should NOT be pushed to any public repo.
To deploy contracts to Kovan, Rinkeby, Goerli live test networks, we perform the following actions;
Goerli
$ brownie run scripts/script_factory --network goerli
Kovan
$ brownie run scripts/script_factory --network kovan
Rinkeby
$ brownie run scripts/script_factory --network rinkeby
Local
$ brownie run scripts/script_factory --network ganache-local
Development
$ brownie run scripts/script_factory --network development
Before running the above last two commands to deploy to local ganache, make sure ganache CLI or ganache UI is online.
After deploying the contracts to the respective test networks, we should have a newly generated build folder with the new contract ABIs and deployment addresses in the respective text networks. We copy the build folder to the client/build directory;
$ cp -r build client/build
We install all the front-end packages by navigating to the client directory and running npm install as shown below;
$ cd Jamii_Blockchain_Voting/client; npm install;
To start the client our current working directory should be 'Jamii_Blockchain_Voting/client'. So we run the following command to start the local dev client and server;
$ npm run dev
If you need help with setting up the project locally for development or have other questions - don't hesitate to write me @ lumungep12@gmail.com
- Fork the repo and create your branch from
master
. - Make sure your code lints and is correctly formatted.
We use GitHub issues to track public bugs, although we will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist.
Please follow the Coding Style documentation.
By contributing to the Jamii ballots, you agree that your contributions will be licensed under its license.