who doesn't like losing money
This 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/master
into your local branch - Verify that your changes still work as expected
- Merge your branch into
master
and 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 [email protected]:alexscheitlin/lottery-dapp
cd lottery-dapp/client/
npm install
Detailed information can be found here: README.
npm install -g truffle
# or
sudo npm install -g truffle
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
- Start a local blockchain with
ganache-cli
in a terminal - which will most likely be running on:http://127.0.0.1:8545
). - Open
Metamask
in your browser and login with your wallet. - Click on the network dropdown and select Custom RPC.
- Scroll down and enter the copied
RPC Server
ofganache-cli
into the New RPC URL field. - Hit Save.
- Switch to your
ganache-cli
an 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-cli
and hit Import. You should now be logged in with an Account from theganache-cli
network 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 Contracts
on theGanache
network:# Terminal Tab #1 truffle migrate --reset
- Start the
Truffle
console:# Terminal Tab #1 truffle console
- Start the
React
client:# Terminal Tab #2 cd /path/to/lottery-dapp/client npm install npm start
localhost:3000
should be opened automatically in your browser