Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

chromastake

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.

Prerequisites

  • You will need NodeJS v8.9.4 or later. NodeJS and installation instructions can be found for all major operating systems at: https://nodejs.org/en/download/.

  • You will need truffle installed globally. If you haven't done so:

$ npm install -g truffle

Ensure that it was installed correctly by running:

$ truffle version

You should see

Truffle v5.0.7 (core: 5.0.7)
Solidity v0.5.0 (solc-js)

Installing

  • Clone this repo to your local machine using https://github.com/ptstory/chromastake.git
  • Note that the node_modules folder is not included in the repo, so you will need to install the dependencies from the included package.json.

After cloning the repo, navigate to the directory containing package.json and run:

$ npm install

Once the dependencies have been installed, navigate to the directory containing truffle-config.js and run:

$ truffle version

You should see

Truffle v5.0.7 (core: 5.0.7)
Solidity v0.5.0 (solc-js)

Using the program

  1. Launch Ganache - this will start up a local blockchain for you to point MetaMask to.
  2. Run truffle migrate --reset to compile the contracts and replace the JSON build files.
  3. [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.

Image of account address fetched by web3

Image of account address printed by Truffle

  1. Open the MetaMask extension and import the wallet produced by Ganache by pasting the mnemonic into MetaMask Image of mnemonic in Ganche Image of mnemonic imported into MetaMask

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

  3. Run npm run serve.

  4. View the app in your browser at at localhost:8080.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages