This project is an unfinished smart contract for Ethereum that is used in trainings.
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.
To use the project, clone the repository:
$ git clone https://github.com/chrisdotn/ethdemocracy.git
Change into the directory and do a
$ npm install
To develop with the project make sure to have testrpc running.
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 aweb3
-enabled Javascript console for manual interaction with the contracts.
To interact with the frontend use:
npm run build
build the frontend using webpacknpm run dev
build the frontend using webpack and serve it tolocalhost:8080
. This command will monitor changes to the frontend and redeploy if needed.