Git Product home page Git Product logo

ide-alpha's Introduction

Titan IDE

The complete Smart Contract Development Environment.

Usage

  1. Download IDE server.

  2. Setup

     // with yarn (recommended)
     cd server && yarn && yarn start
     // with npm
     cd server && npm install && npm run start
  3. Visit https://ide.titan-suite.com.

Video Guide

Titan IDE

Unlocking an account

Requirements: Web3 provider url, Account, Password

  1. Start by inputting a web3 provider url.
  2. Once a valid AION node is detected a dropdown will be populated with the list of accounts.
  3. Input password linked to the chosen account.

Deploying a contract

Requirements: Web3 provider url, Account, Password, Contract name

Optional: Gas, Contract arguments

Deploy unlocks the selected the account then compiles and deploy the contract. After successful deployment Contract interaction is enabled at http://localhost:4001/graphql.

  1. Steps listed above
  2. Name of the contract to deploy Note: Deploy automatically handles compile and unlock.
Side note: The fallback value for Gas will be 1500000

Compiling a contract

Requirements: Web3 provider url

  1. Once the contract is ready click the compile button.
  2. A tree view will be populated with the contract information.

Interacting with web3

Requirements: valid Web3 provider url

  1. titan 'any web3 command'

Bash

Interacting with already deployed Contract

Requirements: valid Web3 provider url, ABI, Deployed contract address

Optional: Account, Gas

  1. Input the Abi and Deployed contract address
  2. After the ABI successful parsed Contract interaction will be enabled at http://localhost:4002/graphql.

Interacting with functions

Based on the Example Contract in the screenshot above here is how we can interact with the functions using GraphQL Queries and Mutations:

1. Querying variable num

{
  num {
    uint128_0{
      int
    }
  }
}

Num

2. Adding 5 to num

{
  add(a: 5) {
    uint128_0 {
      int
    }
  }
}

Add

3. Combining Queries together

query {
  num{
    uint128_0{
      int
    }
  }
  add(a:25){
    uint128_0{
      int
    }
  }
}

Combined

4. Setting num to 96

mutation  {
  setA(a: 96){
     blockHash
     blockNumber
  }
}

Set

ide-alpha's People

Contributors

arjitkhullar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dhagell ben-haim

ide-alpha's Issues

Issue with solidity arrays when trying to deploy and interact with graphql playground

Contract code:

pragma solidity ^0.4.9;


contract ExampleTwo {
    struct Container {
        uint128[] arr;
    }  

    Container container = Container(new uint128[](0));

    function read() public returns(uint128[]) {
        return container.arr;
    }
    
    function write(uint128 item) public {
        container.arr.push(item);
    }

}

GraphQL:

query { 
  read{
    uint128Arr_0{
      int
      string
    }
  }
} 

At first I was not able to deploy, but restarting the server helped. Then once I deployed the contract when I try to query the read function I get the following error:

{
  "data": {
    "read": {
      "uint128Arr_0": null
    }
  },
  "errors": [
    {
      "message": "Expected Iterable, but did not find one for field read.uint128Arr_0.",
      "locations": [
        {
          "line": 3,
          "column": 5
        }
      ],
      "path": [
        "read",
        "uint128Arr_0"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "Error: Expected Iterable, but did not find one for field read.uint128Arr_0.",
            "    at invariant (/Users/ollie/Aion/server/node_modules/graphql/jsutils/invariant.js:19:11)",
            "    at completeListValue (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:673:65)",
            "    at completeValue (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:643:12)",
            "    at completeValueWithLocatedError (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:580:21)",
            "    at completeValueCatchingError (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:556:21)",
            "    at resolveField (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:497:10)",
            "    at /Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:364:18",
            "    at Array.reduce (<anonymous>)",
            "    at executeFields (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:361:42)",
            "    at collectAndExecuteSubfields (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:772:10)",
            "    at completeObjectValue (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:762:10)",
            "    at completeValue (/Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:660:12)",
            "    at /Users/ollie/Aion/server/node_modules/graphql/execution/execute.js:617:14",
            "    at <anonymous>",
            "    at process._tickDomainCallback (internal/process/next_tick.js:228:7)"
          ]
        }
      }
    }
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.