who doesn't like losing moneyThis project was bootstrapped with Truffle.
npm install -g truffle
truffle unbox react- (Optional) Create a new issue and add it to the To Do column of Lottery dApp project
- Assign yourself an issue from the To Do column of the Lottery dApp project and move it to the In Progress column
- Pull the latest changes from
origin/master - Create a new local branch beginning with the issue number (e.g.,
4-feature). - Commit to this branch mentioning the issue number in the commit message (e.g.
add functionality xyz (#4) - Finish your implementation on the branch
- Pull and merge the latest changes from
origin/masterinto your local branch - Verify that your changes still work as expected
- Merge your branch into
masterand push the changes - Close the issue and move it to the Done column of the Lottery dApp project
- Git command line interface
- Node.js command line interface
- Metamask Extension for your browser (including wallet)
- Ganache
- Ganache-CLI to spin up a blockchain with instant mining
- Ganache version 2.0.1 or newer
onetime setup
git clone https://github.com/alexscheitlin/lottery-dapp
# or
git clone git@github.com:alexscheitlin/lottery-dappcd lottery-dapp/client/
npm installDetailed information can be found here: README.
npm install -g truffle
# or
sudo npm install -g truffleInstall 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- Start a local blockchain with
ganache-cliin a terminal - which will most likely be running on:http://127.0.0.1:8545). - Open
Metamaskin your browser and login with your wallet. - Click on the network dropdown and select Custom RPC.
- Scroll down and enter the copied
RPC Serverofganache-cliinto the New RPC URL field. - Hit Save.
- Switch to your
ganache-clian copy one of the private keys. - Back in
Metamask, click on the colored circle on the top right and select Import Account. - Paste the private key from
ganache-cliand hit Import. You should now be logged in with an Account from theganache-clinetwork with a balance of 100 ETH.
everytime to run the environment
- Pull the latest commits:
# Terminal Tab #1 cd /path/to/lottery-dapp git pull
- Start local blockchain with
ganache-cli. - Compile the
Smart Contracts:# Terminal Tab #1 truffle compile - Deploy the
Smart Contractson theGanachenetwork:# Terminal Tab #1 truffle migrate --reset - Start the
Truffleconsole:# Terminal Tab #1 truffle console - Start the
Reactclient:# Terminal Tab #2 cd /path/to/lottery-dapp/client npm install npm start
localhost:3000should be opened automatically in your browser
