Skip to content

alexscheitlin/lottery-dapp

Repository files navigation

Lottery dApp

Lottery dApp

Challenge Task 2019

who doesn't like losing money

This project was bootstrapped with Truffle.

npm install -g truffle
truffle unbox react

Contribution Workflow

  1. (Optional) Create a new issue and add it to the To Do column of Lottery dApp project
  2. Assign yourself an issue from the To Do column of the Lottery dApp project and move it to the In Progress column
  3. Pull the latest changes from origin/master
  4. Create a new local branch beginning with the issue number (e.g., 4-feature).
  5. Commit to this branch mentioning the issue number in the commit message (e.g. add functionality xyz (#4)
  6. Finish your implementation on the branch
  7. Pull and merge the latest changes from origin/master into your local branch
  8. Verify that your changes still work as expected
  9. Merge your branch into master and push the changes
  10. Close the issue and move it to the Done column of the Lottery dApp project

Prerequisites

Setup

onetime setup

Clone the Project

git clone https://github.com/alexscheitlin/lottery-dapp

# or

git clone git@github.com:alexscheitlin/lottery-dapp

Set up Client

cd lottery-dapp/client/
npm install

Detailed information can be found here: README.

Install Truffle

npm install -g truffle

# or

sudo npm install -g truffle

Install Ganache-CLI

Install with @beta to get the latest updates which fixes a bug that caused wrong gas estimations (more details).

npm install -g ganache-cli@beta

# or

sudo npm install -g ganache-cli@beta

Setup Metamask

  1. Start a local blockchain with ganache-cli in a terminal - which will most likely be running on: http://127.0.0.1:8545).
  2. Open Metamask in your browser and login with your wallet.
  3. Click on the network dropdown and select Custom RPC.
  4. Scroll down and enter the copied RPC Server of ganache-cli into the New RPC URL field.
  5. Hit Save.
  6. Switch to your ganache-cli an copy one of the private keys.
  7. Back in Metamask, click on the colored circle on the top right and select Import Account.
  8. Paste the private key from ganache-cli and hit Import. You should now be logged in with an Account from the ganache-cli network with a balance of 100 ETH.

Run Environment

everytime to run the environment

  1. Pull the latest commits:
    # Terminal Tab #1
    cd /path/to/lottery-dapp
    git pull
  2. Start local blockchain with ganache-cli.
  3. Compile the Smart Contracts:
    # Terminal Tab #1
    truffle compile
  4. Deploy the Smart Contracts on the Ganache network:
    # Terminal Tab #1
    truffle migrate --reset
  5. Start the Truffle console:
    # Terminal Tab #1
    truffle console
  6. Start the React client:
    # Terminal Tab #2
    cd /path/to/lottery-dapp/client
    npm install
    npm start
  7. localhost:3000 should be opened automatically in your browser

⚠️ Make sure your Metamask is connected to the correct network! ⚠️

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •