ethereum-voting
ethereum-voting copied to clipboard
Descentralized voting application using ethereum.
Ethereum-Votimg
Descentralized voting application, DAPP, using ethereum.
Table of content
-
Getting Started
- Built With
- Prerequisites
- installing
- For OSX and Linux
- Testing
-
Run Dapp
- Loval Development with Truffle
- Local Development with TestRPC
- Deployment in testnet or mainnet
- Contributing
- Credits
- License
Getting Started
Built With
- Angular5 - The web framework used
- Web3j - Integration with Ethereum client
- Truffle - The most popular development framework for Ethereum
- Bootstrap - Bootstrap is an open source toolkit for developing with HTML, CSS, and JS.
Prerequisites
Check first for at least node 9.2.0, npm 5.5.1:
nodejs -v
npm -v
npm is bundled with Node.js, so to install npm you only need to install Node.js on your Ubuntu/Debian
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
Installing
- Fork this repo by clicking Fork button in top-right corner of this web page. Continue to follow instruction steps from your own ethereum-voting repo.
- Clone your own "ethereum-voting" repo. Copy the link from the "Clone or download" button near the top right of this repo's home page.
- The rest of these steps must be done from your machine's command line. See the Run Dapp or Deployment section to continue if you already have the repository installed.
For OSX and Linux
-
From the desired directory you wish to copy the "ethereum-voting" folder with source files to.
git clone {paste your own repo link here}
NOTE: Please use
develop
branch for contributing.git clone -b develop {paste your own repo link here}
-
Change directories to proposal-scheme:
cd ethereum-voting
-
Make sure you have the pre-requisites NodeJS (v8.4.0 or higher) and npm (5.4.1 or higher) installed.
-
Install dependencies from within proposal-scheme directory:
npm install
-
That is it, you are now ready to run the proposal-scheme dapp! Head to the Run dapp section for further instructions.
Run Dapp
For local node using truffle follow these steps.
truffle develop
Inside the truffle console write,
compile
migrate
Run the webpack server for front-end hot reloading (outside the development console). Smart contract changes must be manually recompiled and migrated.
Serves the scheme front-end on http://localhost:4200
npm start
If port already in use error run
sudo lsof -t -i tcp:4200 | xargs kill -9
Running the tests
TODO: Add testing coverage
truffle test
Local Development with TestRPC
Change your environment variable in truffle.js to your desired host and port.
networks: {
development: {
host: 'localhost',
port: 8545,
network_id: '*' // Match any network id
}
In a new terminal execute testrpc
testrpc
Recompile and migrate your truffle contracts to this development node
truffle compile
truffle migrate
Start your client.
Deployment
You can deploy in infura or other alternatives following their instructions.
Credits
Arnau Díaz. [email protected]
License
MIT