Chromastake is a decentralized application that allows users to bet on a randomly chosen color and win ether. It is made with Vue.js, Ethereum web3.js, and Ethereum smart contracts written in Solidity.
-
You will need
NodeJSv8.9.4 or later.NodeJSand installation instructions can be found for all major operating systems at: https://nodejs.org/en/download/. -
You will need
truffleinstalled globally. If you haven't done so:
$ npm install -g truffleEnsure that it was installed correctly by running:
$ truffle versionYou should see
Truffle v5.0.7 (core: 5.0.7)
Solidity v0.5.0 (solc-js)-
You will need the Chrome extension
MetaMaskto handle your Ethereum wallet. It can be found at: https://metamask.io/. -
You will need
Ganacheto have access to a local blockchain for testing. It can be found at: https://truffleframework.com/ganache.
- Clone this repo to your local machine using
https://github.com/ptstory/chromastake.git - Note that the
node_modulesfolder is not included in the repo, so you will need to install the dependencies from the includedpackage.json.
After cloning the repo, navigate to the directory containing package.json and run:
$ npm installOnce the dependencies have been installed, navigate to the directory containing truffle-config.js and run:
$ truffle versionYou should see
Truffle v5.0.7 (core: 5.0.7)
Solidity v0.5.0 (solc-js)- Launch Ganache - this will start up a local blockchain for you to point MetaMask to.
- Run
truffle migrate --resetto compile the contracts and replace the JSON build files. - [OPTIONAL] If you intend to store your account address as an environment variable for security, replace the env variable in the .env file with the account address printed by Truffle in your terminal. Otherwise, you must rely on web3 to fetch your account address.
-
Open the MetaMask extension and import the wallet produced by Ganache by pasting the mnemonic into MetaMask

-
Switch from the default mainnet to http://127.0.0.1:7545 in MetaMask. Note: this address must match the one shown in Ganache.

-
Run
npm run serve. -
View the app in your browser at at
localhost:8080.
- Perry Story - (https://github.com/ptstory)
- Edwin Aramburo - (https://github.com/earamburo)
- Nicole Grizzle - (https://github.com/thirdlight)
- Harsha Goli - (https://github.com/arshbot)
- Brittney Hill - (https://github.com/)
This project is licensed under the MIT License - see the LICENSE.md file for details
- Dr. Juan Banda for the assignment
- Learning materials used: https://github.com/marlowl/vue-voting-dapp, https://github.com/jmbanda/CSC4890_election_dapp, and countless Ethereum Stack Exchange questions

