Skip to content

swuwu/CS480

Repository files navigation

CS480 Blockchain Application

Poll Creator using Blockchain API

Requirements Analysis

Project Requirements

  • Utilize a block-chain platform to achieve functionality

Application Requirements

Shall Requirements

  • Create a new poll
  • Find existing polls to vote for
  • Submit voting option selections to the poll
  • Polls are valid only for a certain length of time
  • Poll results are immutable once the deadline passes

Should Requirements

  • User details are stored along with user's voting selections
  • Poll results include statistics and other desirable user metadata'

Execution of Steps

  1. [Poll Creator] creates a new poll
  2. [Poll Creator] inserts poll details
  3. Application publishes poll
  4. (Substep) User details are verified (extends)
  5. [Poll Voter] finds a poll
  6. [Poll Voter] selects voting choices
  7. (Substep) Voting selection transaction is verified by [Blockchain API] (includes)
  8. [Blockchain API] adds vote selection to the blockchain
  9. Poll expires and triggers generation of poll results
  10. (Substep) Poll result analysis and statistics are generated (extends)

Frontend Layout

  • Blockchain Poll Homepage -> index.html
    • Create -> creator/index.html
      • Submit Page -> creator/submit.php
    • Vote -> voter/index.php
      • Poll Page -> voter/poll.php
        • Submit Page -> voter/submit.php
      • Delete Page -> voter/delete.php
    • Results -> results/index.php
      • Results Page To Do
      • Delete Page -> results/delete.php
    • Team -> about/index.html

Setup

Option 1

  1. VM

or

Option 2

  1. Source Code (GitHub)
  2. MySQL
  3. Multichain/Blockchain
  4. Server

Option 1

1. Virtual Machine

Option 2

1. Source Code

2. MySQL Setup

  • install MySQL
  • create users and grant permissions
    • on root account create cs480 user and grant permissions
    CREATE USER 'cs480'@'localhost' IDENTIFIED BY 'password';  
    GRANT SELECT,INSERT,CREATE,DELETE,DROP ON * . * TO 'cs480'@'localhost';
  • create databases and tables
    • on cs480 user create polls database and creators table
    CREATE DATABASE polls;
    use polls;
    CREATE TABLE creators (id TEXT, poll TEXT);

3. Multichain/Blockchain Setup

multichain-util create cs480
multichaind cs480 -daemon
  • change password and port in config folder
    • password can be found in ~/.multichain/cs480/multichain.conf
      • under rpc-password
    • port can be found in ~/.multichain/cs480/params.dat
      • under default-rpc-port

4. Server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published