This is an application for creating events, buy and sell tickets on the Ethereum blockchain. This prototype was developed as part of the "Blockchain" Seminar at the University of Zurich.
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 Ticketing dApp project
- Assign yourself an issue from the To Do column of the Ticketing 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 Ticketing dApp project
- Git command line interface
- Node.js command line interface
- Metamask Extension for your browser (including wallet)
- Ganache-CLI to spin up a blockchain with instant mining
We don't use Ganache at the moment, as it fails somehow. Everything works though with Ganache-CLI. If at some point we switch back, the README should be updated.
onetime setup
git clone https://github.com/simibac/ticketing-dapp.git
# or
git clone git@github.com:simibac/ticketing-dapp.git
cd ticketing-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/ticketing-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/ticketing-dapp/client npm install npm start
localhost:3000
should be opened automatically in your browser