XYO Foundation Dev Portal
  • Guides

›Smart Contract Apps

Getting Started

  • Getting Started

Updates

  • Latest Updates
  • News Archive

Changemaker Challenge

  • UC San Diego and XYO

Using our Mobile SDKs

  • SDK Guide

XYO Foundation

  • Open Source Initiative

XYO Network App

  • How To Use

Explore App

  • How To Use

Bridge

  • Bridge X

Smart Contract Apps

  • Dapploy
  • Dapper
  • SCSC Library

SDKs

  • Android SDK
  • Swift SDK
  • Node Core SDK
  • Swift Core SDK
  • Kotlin Core SDK

Tools

  • XYO Tools

DAPPER

The XYO Foundation provides this source code available in our efforts to advance the understanding of the XYO Procotol and its possible uses. We continue to maintain this software in the interest of developer education. Usage of this source code is not intended for production. Developer usage of the Dapper app is intended for educational purposes on geospatial location blockchain protocol.

Difficulty Level: Intermediate

Getting Started

Install

yarn it out in the project directory:

yarn

Run dapper

yarn start

Dapploy Some Contracts locally

We need to deploy a suite of smart contracts

Before we do let's set up an array of account addresses using Ganache:

There are two ways you can do this:

Install Ganache

  1. If you don't already have it, download and install Ganache from their site

Install MetaMask

  1. Same with MetaMask from their site

  2. Configure Ganache on 8545:

  • Open Ganache
  • Click the Gear Icon ( ⚙️ ) to open Preferences.... Make sure that port is set to 8545.
  • Click "Save and Restart" in the top-right of Ganache
  1. Configure Metamask network to localhost
  • Sign into Metamask and change Network on Metamask to localhost 8545
  1. Add ganache account to metamask
  • In your Ganache UI, you'll see a list of ~10 addresses.

Other ganache options

Or:

Install Ganache CLI

npm install -g ganache-cli

or

yarn global add ganache-cli

Then enter this command in its own terminal(its recommended that in local development you maintain the same mnemonic and accounts):

ganache-cli --port 8545 --deterministic

Once you start up ganache, do not close the terminal window. You will see a mnemonic and 10 ethereum account addresses and the amount of ether for each

  1. In another terminal window, use Dapploy and create your first standalone smart contact project:
dapploy init my-first-coin -s ERC20
cd my-first-coint

dApploy the contracts

dapploy

This command will compile, migrate, and deploy your contracts in your local environment

At this point, you could interact with your contracts using truffle console but why do that when you can now use dApploy?

dapploy -p

The -p tag pins your contracts to IPFS for remote access

Note Copy your IPFS hash which can be found after running dapploy -p, you will need it in the next section

Running dapploy
Contracts stored to IPFS <your IPFS hash>

View Local Contracts on IPFS

dApper's settings interface allows you to set up the environment to upload your ABI through an IPFS address, this is where we use the ipfs address from our dApployed contract

dapper-ipfs-config

Set the portis network to Development (local) and in the text input under Add ABI and IPFS address paste your IPFS hash, which was given to you when you ran dapploy -p on your my-first-coin project:

Running dapploy
Contracts stored to IPFS <your IPFS hash>

Play with your Smart Contracts

You should now see your contracts in the contract simulator

dapper-contract-simulator

Last updated on 4/16/2020
← DapploySCSC Library →
  • Getting Started
    • Install
    • Run dapper
  • Dapploy Some Contracts locally
    • Install Ganache
    • Install MetaMask
    • Other ganache options
    • dApploy the contracts
    • View Local Contracts on IPFS
  • Play with your Smart Contracts

XYO | Developers

Copyright © 2020 XYO
DocsExplore AppProtocolSource Code
Community
GitHubTwitter