Ticketing dApp

Blockchain Ticketing

Software Project

University of Zurich

Contribution Workflow

  1. Create a new issue (automatically adds the issue to the To Do column of Ticketing dApp project)
  2. Assign yourself an issue from the To Do column of the Ticketing 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 Ticketing dApp project

Prerequisites

  • Git command line interface
  • Node.js command line interface
  • Metamask Extension for your browser communicating with the Ethereum blockchain
  • Ganache to spin up a blockchain with funded test accounts and instant mining

Project Setup

Clone the Project

git clone https://github.com/simibac/bc-ticketing

Set up Client

cd bc-ticketing/client/
npm install

Install Truffle

sudo npm install -g truffle

Setup Metamask

  1. Start a local blockchain by opening the Ganache application.
  2. Create a new workspace and add bc-ticketing/truffle-config.js to the project and safe the workspace.
  3. Copy the mnemonic phrase (12 word seed phrase) in the Ganache application.
  4. Open Metamask in your browser (Google Chrome recommended).
  5. Click on import using account seed phrase and paste the mnemonic seed phrase. (No funds are shown because Metamask is not connected to the local network yet.)
  6. Click on the network dropdown and select Custom RPC.
  7. Enter Ganache as the Network Name and the Ganache network configuration as the RPC URL which is by default http://127.0.0.1:7545.
  8. Click Save.
  9. You should now be logged in with an account(s) from the Ganache application with a balance of 100 ETH.

Run Environment

everytime to run the environment

  1. Pull the latest commits:
    # Terminal Tab #1
    cd /path/to/bc-ticketing
    git pull
  2. Start local blockchain with by opening the Ganache application.
  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 Vue.js client:
    # Terminal Tab #2
    cd /path/to/bc-ticketing/client
    npm install
    npm run serve
  7. localhost:8080 serves the application

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