_images/Simba-NS.png

SIMBA React Demo Docs

Here is a playlist on the SIMBA Chain Youtube channel to get you up to speed on using the dashboard.

Smart Contract

pragma solidity ^0.4.24;

contract Application {

function Application() public {} enum Assets {

game

} Assets _turns = Assets.game;

function turns (
string assetId, string name, string turn0, string turn1, string turn2, string turn3, string turn4, string turn5, string turn6, string turn7, string turn8, string turn9)

public {}

}

Creating an app on the SIMBA Dashboard

Before Starting make sure you have an account on the Simba Dashboard and an Ethereum wallet with Ether in it on the Circle of life network

  • Create The Smart Contract
  • Create The Application
  • Configure The Application(Ethereum Blockchain, Circle of Life, IPFS Filesystem, Permission disabled)
  • Generate Application API Key(This is not the API name)
  • Generate Configuration API Key

Note

Both application an application API key and a configuration API key is needed. These keys are not interchangable.

Converting the React Demo example to your app

  • Everything you need to change is inside of index.js
  • Changing the url to your own
    • ~line 127
    • ~line 168
    • ~line 228
    • ~line 482
    • ~line 516
    • ~line 729
  • Changing the Configuration API Keys(make sure this isn’t a application API key)
    • ~line 129
    • ~line 731
  • Changing the Application API Keys(make sure this isn’t a configuration API key)
    • ~line 170
    • ~line 230
    • ~line 484
    • ~line 518
  • Run locally
    • with a terminal at the project folder run npm start
    • your project should be at localhost:3000
  • Deploying the application

Based off of this https://reactjs.org/tutorial/tutorial.html

Github Repo https://github.com/SIMBAChain/ReactDemo

React Demo https://simbachain.github.io/ReactDemo/