Aion University

So you want to be a DApp developer?


Well you've come to the right place. You'll find comprehensive guides and documentation to help you start developing with Aion as quickly as possible, as well as support if you get stuck. Let's jump right in!

Let's DApp

Titan Suite

IDE: Build your Aion application online using this browser IDE.

What is it?

Titan Suite is a development kit which enables quick, simple, and secure dApp building experience for anyone wishing to build on Aion.

Titan Suite offers a web-based IDE (Integrated Development Environment) and a CLI (Command Line Interface) which both allows you to have a seamless experience creating smart contracts and deployment onto the network.

Let's have a look at what you can do with Titan Suite.
Features include:

  • Compile Solidity smart contracts
  • Account Management
  • Deploy contracts (Mainnet & Testnet)
  • Syntax highlighting and linting
  • Unit tests in Mocha (CLI Feature Only)
  • Interact with any node
  • Skeleton code generators (Currently available for React)

Looking for more? Check out their Github

Using the IDE

Setup

We have two options on how we can use the IDE.

1. Web Based

2. Desktop App
You can also have IDE installed on your computer. You'll need to open this link in a Google Chrome browser

  • Top right corner you'll see 3 vertical dots
  • Click these dots - you'll see more options available
  • Choose "Install Titan IDE"
Installing IDE

Installing IDE

Get Comfortable

If you followed any of the steps above - you should be greeted with a beautiful & sleek interface right off the get go.

So, the IDE has 4 main sections:

  1. File Explorer
  2. Editor
  3. Console
  4. Control Panel
Titan IDE Components

Titan IDE Components

1. File Explorer

  • Add a file: Click the "+" Button
  • Delete a file: Click the "Garbage" Icon
Adding a new contract

Adding a new contract

2. Editor

This panel is where you can edit your contracts that you want to be compiled or deployed. It also has proper syntax highlighting for easier reading and editing. It's good to note that whatever file you have open in the editor, is the active file for the options in the the control panel.

3. Console

You can find details of the transactions that you call (whether it be deploying or interacting with a contract) in the console found under the editor. Transaction receipts will be displayed, where you can expand to view more details of the transaction itself, and as well copy the receipt with one button.

Contract Deployment Receipt

Contract Deployment Receipt

4. Control Panel

The control panel allows you to action different options based on the the file you have opened in your editor. Control Panel Options:

Compile a Contract

The FastVM is compatible with Solidity Smart Contracts written in 0.4.15 or lower.

Two Steps to Compile a Contract

'Compile' Tab View

'Compile' Tab View

Set the Provider

First, we have to connect to an Aion node. You can do this by setting the Provider.
There are three available methods:
1. Web3 Providers

2. Inject the Web3 Provider

3. In-browser Compiler

  • Check the 'Use in browser compiler' box
'Use in browser compiler' view

'Use in browser compiler' view

Click the circle :white-check-mark+: to SET the provider (Green = :thumbsup+: , Grey :thumbsdown+:)

Compile Contract
  • Hit that 'Start to Compile' button
  • If successful, the dropdown menu below should have your contract file name
  • After you choose a contract from the menu, you'll be able to see the details of the compiled contract (bytecode and ABI).
Copy the compiled contract's output by clicking on the clipboard icon to the right of `Details` Button

Copy the compiled contract's output by clicking on the clipboard icon to the right of Details Button

Contract Details

Contract Details

Account Management

In order to deploy or interact with a contract, we'll need an account with AION balance in it.

Using Web3 Provider

If using a Web3 Provider (or Local Node)

Create an Account
  • Click 'Create an Account' - (yes, to create an account)
'Accounts' Tab View

'Accounts' Tab View

  • Note: The account details will be copied to your clipboard. It will not show up on the accounts list just yet. Save this information in a SAFE place on your computer. You will need to use your private key for the 'Import Private Key

The copied 'Account Details' should look similar to the snippet below:

{
 "privateKey":"********************************************************************************************************************************",
  "address":"0xa0200dd3ad49590652b3b9903bd879c29d97099c5c032778f6f2a82d01ce864b"
}

Import an Account

You will need your private key ready for this step!

  • Click the 'Import Private Key' Button
  • Enter your private key in the window that pops up
Import Private Key Window

Import Private Key Window

  • Click 'Confirm'
    You have now successfully imported your account into Titan!

Injecting a Web3 Provider

If you're using an in-browser wallet application, such as AIWA, your active account should show up in the accounts list automatically.

Account injected by AIWA

Account injected by AIWA

  • Click 'Unlock', then enter your password you set for your AIWA wallet app
  • You can now use this account in the 'Run' Tab

Need some test AION balance?

Hop over to the faucet and get 10 AION coins (For Mastery Testnet)

Deploy a Contract

Alright, time to deploy a contract onto the network.

'Run' Tab View

'Run' Tab View

Let's set the stage

  1. Provider Address: Set your provider
  2. Account: Select your account from the dropdown menu. Click the refresh button to see active accounts. If no accounts are show, you'll have to create/import/unlock an account in the 'Accounts' tab.
  3. Gas Limit, Gas Price: Set the desired Gas Limit, Gas Price, Value.

Deployment

  • Select your compiled contract from the dropdown list, set the parameters (if there are parameters), then click 'Deploy'

Once deployed, you should see a receipt in the console under the text editor. Remember you can expand that to find more details such as the contract address, and the transaction hash. You can use this information to look at the explorer to see it on the blockchain.

Deploying a contract (using a Web3 Provider)

Deploying a contract (using a Web3 Provider)

Interact with a Contract

Two ways to load your contract:

  1. Deployed via Titan: You should be able to interact with it immediately in the Run tab - scrolling down past the Deploy button.
  2. Load Contract from Address: Make sure your contract is compiled, enter the contract address in the 'Load contract from address' input, then click the 'At Address'.

You can recompile the contract by clicking on the 'refresh' button next to the contract selection dropdown. Make sure to have the file open in the editor tab that you would like have compiled

Let's Interact!

  • Click the Contract to expand it and reveal all public functions within it
  • Each public function is represented as a button that you can click and pass parameters to
  • Each function would produce a transaction that can be viewed in the Console section (beneath the Editor)
Interacting with a contract

Interacting with a contract

Written by Kimcodeashian :fire+: