This project was bootstrapped with Create React App.
This repository hosts the code of the challenge task of the Blockchain and Overlay Networks lecture in the spring semester 2019.
It implements a lottery based on a smart contract written in Solidity, compatible with the Ethereum Blockchain. Fees and prizes are paid directly in ETH.
In order for this project to work properly on your local machine, a few things need to be installed:
ganache-cli
andtruffle
have to be installed globally and in yourPATH
. If they are not, install withyarn global add ganache-cli truffle
.- The Metamask plugin has to be installed in your default browser with the security settings set accordingly (So the React app can connect to Metamask).
If you want to run the project with a development setup and a development blockchain, follow the following steps
- Clone the repo.
- Make sure you have ganache-cli and truffle installed globally and that both are in your
PATH
. If not, runyarn global add ganache-cli truffle
. - Start up a local development blockchain using
ganache-cli
. Runganache-cli -i 5777
. Note the network id, the project will look for a network with id5777
. - Run
yarn install
. - Run
yarn run sc-local
. This will compile and deploy the main contract and dependendent contracts to the local ganache blockchain. - Run
yarn run
to start the React application.
A version of the React app connecting to a deployed contract on Ropsten is hosted on Firebase.