Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Latest commit

 

History

History
45 lines (35 loc) · 2.45 KB

README.md

File metadata and controls

45 lines (35 loc) · 2.45 KB

Charity Raffle dApp

This is a demo dApp built to be deployable on the BlockApps STRATO platform. The app consists of a raffle smart contract and a react user interface. Any user can initiate the creation of a raffle contract. The user determines the number of total tickets, the price per ticket and the perentage to donate to a charity of their chosing, when deploying the smart contract. Various users can purchase these tickets. The raffle is closed and a winner is picked once the total number of participants is reached.

Read the documentation for more information on creating dApps using BlockApps STRATO.

Pre-requisites

A running STRATO multinode network is required to deploy and run this application. Follow the instructions in the STRATO getting started guide to setup a multi-node network. Additional instructions can be found on our Developer Portal.

Building

The STRATO platform expects a zip archive with the following structure:

.zip
├─ contracts/
│   └─ ...all solidity contract files (*.sol)
│
├─ index.html
│
├─ ...other ui application files used by index.html
│
└─ metadata.json

Running the following commands will generate the directory structure and the zip archive under the build folder.

npm install
npm run build

The data in metadata.json is populated from package.json.

This zip archive under build/app.zip can be uploaded directly to STRATO.

Deploying on STRATO

Perform the following steps to deploy this demo app on STRATO.

  1. Access the STRATO dashboard (See STRATO getting started)
  2. Create and faucet and account (a private key) to upload and sign the deployment, using the accounts tab in the STRATO management dashboard. This is only necessary if you do not already have a user account.
  3. Access the Apps tab from the side menu
  4. Click on the Deploy button on the upper right corner
  5. Fill in the user details of the account you are using (see step 2).
  6. Browse or drap and drop the app.zip created by the build script.
  7. Hit Upload
  8. The app should show up on the app dashboard momentarily. Click on the Launch button to use the lottery demo app.