Iguana C9 Setup

Setting up C9 for iguana_dev_2 (or in localhost with ubuntu OS)

  1. First install required packages by executing following commands:

sudo apt-get update sudo apt-get install git cmake libglib2.0-0:i386 libcurl4-openssl-dev

For clarity, lets assume we are installing everything in dir "/home/ubuntu/workspace". Move to this dir using following command

cd /home/ubuntu/workspace

  1. Now download and install nacl_sdk from url https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip and install using following commands.

wget https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip unzip nacl_sdk.zip cd nacl_sdk ./nacl_sdk update

Above commands will install nacl_sdk and add folder peeper_47 in nacl_sdk.

(peeper_47 is lattest version available, it is different from what is mentioned in Getting started Guide)

Add this directory (/home/ubuntu/workspace/nacl_sdk/peeper_47) into your environment variable NACL_SDK_ROOT. (In the end its explained how its done in ubuntu) And then again move to workspace folder using command

cd /home/ubuntu/workspace

  1. Now clone depot_tools repo by using following command (This repo is necessary for building the chrome app required modules)

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

Again add the depot_tools directory (/home/ubuntu/workspace/depot_tools) to PATH environment variable.

  1. For webports make new directory and add the repo for webport in gclient using following commands. (Using this curl package will be installed in webports)

mkdir webports cd webports gclient config --name=src https://chromium.googlesource.com/webports.git gclient sync

Now install curl using following commands: cd src/bin ./webports install curl

Now we are finished with installing required packages for iguana_dev or iguana repo. And then again move to workspace folder using command.

cd /home/ubuntu/workspace

5 Now clone repo you want to install using following commands (for iguana_dev) git clone https://github.com/SuperNETorg/iguana_dev.git cd iguana

(for iguana) git clone https://github.com/jl777/iguana.git cd iguana

6 Now make both native and frontend app by executing script (for native app) ./m_unix (for frontend) ./m_pnacl

For frontend (building pexe) we can use make command in the app's main directory (/home/ubuntu/workspace/iguana or /home/ubuntu/workspace/iguana_dev).

7 Changing port number for c9.io IDE (not needed if you want to run it locally)

Change 7777 to 8080 in tools/httpd.py file and execute command python tools/httpd.py in app's main directory.

8 Now for running API calls native iguana executable must be running. So move to app's main directory and execute iguana by typing

./iguana

Adding environment variables:

In ubuntu environment variables are defined in .bashrc file in the home directory of user. So in order to add a variable go to home directory and edit the .bashrc file in texteditor (for localhost) cd gedit .bashrc

(c9.io) cd c9 .bashrc

now type export NACL_SDK_ROOT=/home/ubuntu/workspace/nacl_sdk/peeper_47 export PATH=/home/ubuntu/workspace/depot_tools:$PATH

Errors:

  1. While installing curl in webports you might get error with message "current version of peeper already contain gtest". Just delete or rename the folder "gtest" to gtest-old and re-execute the command.

  2. Before executing command just make sure you are in your workspace or required folder.

  3. Don't forget to re-open the terminal after adding environment variable. Or you will get "No command found" error.

Posted on Dec 04, 2017