Skip to content

A liquid democracy implementation using the ethereum blockchain

License

Notifications You must be signed in to change notification settings

MaibornWolff/ethdemocracy

 
 

Repository files navigation

EthDemocracy

This project is an unfinished smart contract for Ethereum that is used in trainings.

CircleCI

Use Case

The project provides a stub for a smart contract that implements a simple liquid democracy on the blockchain. The projects supplies tests for the stub that all fail initially. During the training we want to actually implement the contract so that the tests all succeed.

Screenshot of EthDemocracy

Installation

To use the project, first clone the repository:

$ git clone https://github.com/MaibornWolff/ethdemocracy.git

Then change into the directory and do a

$ npm install

to install all needed dependencies and binaries.

Usage

To develop with the project make sure to have ganache-cli running. It is installed by default and can be started by executing ./ganache-cli -d.

After all packages have installed you can use the truffle commands to interact with the project:

  • ./truffle compile will compile smart contracts that have been changed since the last compile.
  • ./truffle compile --all will compile all smart contracts.
  • ./truffle migrate will compile smart contracts and deploy them to the default network.
  • ./truffle migrate --network staging will compile and deploy to network staging.
  • ./truffle migrate --reset will compile and deploy all smart contract even if they haven't changed.
  • ./truffle test will run the tests in directory $(PROJECT)/test.
  • ./truffle test ./path/to/test/file.sol will run the test in the specified file.
  • ./truffle console will open a web3-enabled Javascript console for manual interaction with the contracts.

To interact with the frontend run the following commands in a different console tab:

  • npm run build build the frontend using webpack
  • npm run dev build the frontend using webpack and serve it to localhost:8080. This command will monitor changes to the frontend and redeploy if needed.

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 51.2%
  • JavaScript 36.8%
  • HTML 9.5%
  • CSS 2.5%