Starter Code for creating Aion Roulette demo dApp
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contracts
img
src
.gitignore
LICENSE
README.md
build.js
index.html
package-lock.json
package.json
webpack.config.js

README.md

Aion Pet Roulette

Four Animals in a Row

This is the repository for the Aion Animal Roulette Tutorial! Everything here is built on top of the Aion Network. Head on over to the guide that will teach you on how to:

  1. Setup your Environment
  2. Write the Smart Contract (Solidity v0.4.15)
  3. Compile/Deploy the Smart Contract via ~ Titan Suite
  4. Create a front-end application that allows users to place bets
  5. Connect the front-end application w/ your deployed contract

Feel free to clone, fork, change, and do whatever you want to with this repo!

Prerequisites

  1. Install Node.js & NPM if you haven't already NPM comes pre-packaged with Node, so you only have to follow the one link.

  2. Once you've got NPM on your computer, install Webpack, Webpack CLI, and http-server:

    npm i -g webpack webpack-cli http-server
  3. Grab your Nodesmith URL. If you don't have Nodesmith setup, follow our setup guide.

    Your URL should look something like this: https://api.nodesmith.io/v1/aion/testnet/jsonrpc?apiKey=abcdef123456abcdf123456abcdef123456. Make sure you select Testnet (Mastery) from the dropdown menu, otherwise you'll be building your dApp on the Mainnet network.

  4. Finally, get the latest version of the AIWA Chrome extension install. You can also install AIWA on the Brave browser. If you don't have AIWA setup, follow our setup guide.

Install

  1. Clone this repository:

    git clone https://github.com/aion-kimcodeashian/aion-roulette-tutorial.git
  2. Open src/js/index.js and edit line 48 with your Nodesmith URL. It should look something like this:

    47  // Fallback Nodesmith Connection
    48  web3 = new Web3(new Web3.providers.HttpProvider("https://api.nodesmith.io/v1/aion/testnet/jsonrpc?apiKey=abcdef123456abcdf123456abcdef123456"));
    49
    50 // Contract Instance
  3. Install all the NPM dependencies:

    npm install
  4. Start the local HTTP Server:

    http-server
  5. Go to http://localhost:8080/

Rebuilding after Making Changes

  1. When you make any changes to the code you'll have to rebuild the project:

    npm run-script build
  2. Then just refresh your browser to see your changes!