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.
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.
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.
Perform the following steps to deploy this demo app on STRATO.
- Access the STRATO dashboard (See STRATO getting started)
- 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.
- Access the
Apps
tab from the side menu - Click on the
Deploy
button on the upper right corner - Fill in the user details of the account you are using (see step 2).
- Browse or drap and drop the
app.zip
created by the build script. - Hit
Upload
- The app should show up on the app dashboard momentarily. Click on the
Launch
button to use the lottery demo app.