icondev

> hyperconnect the world _

ICON is a scalable smart contract enabled blockchain platform with a long-term goal of interoperability between enterprise and public blockchains. Our goal is to Hyperconnect the World, and by combining groundbreaking technology, a strong community, and relentless growth strategies we believe this goal is reachable.

Get Started    

T-Bears Dev Suite

This tutorial is intended to give an introduction to using T-Bears. This guide will walk you through the basics of setting up your development environment and the usage of T-Bears CLI commands.

T-Bears is a suite of development tools for SCORE. T-Bears provides a project template for SCORE to help you start right away. You can code and test your smart contract locally in an emulated environment, and when ready, deploy SCORE onto the ICON network from command-line interface.

Components

Components

ICON RPC Server

A module that handles ICON JSON-RPC API request and sends response back to the client.

ICON Service

A module that manages the lifecycle of SCORE and its execution. SCORE's state transition is stored in a database.

T-Bears CLI

T-Bears Command Line Interface. Supports following functions :

  • Manage T-Bears service
  • Deploy SCORE
  • Send transaction
  • Send query request

For the details, see below 'Command-line Interfaces(CLIs)' chapter.

T-Bears Block Manager

LoopChain emulator for T-Bears Service. It does not have full 'consensus' and 'peer management' functions. This module handles transaction and emulates block generation.

Message queue

Message queue is used for inter-component communication.

Quick start

You can run T-Bears on your machine by using Docker.

The below command will download T-Bears Docker image and run T-Bears Docker container.

docker run -it --name tbears-container -p 9000:9000 iconloop/tbears

Please check the following links for more information. T-Bears Docker

Building from source

First, clone this project. Then go to the project directory, create a virtualenv environment, and run build script. You can then install T-Bears with the .whl file.

$ virtualenv -p python3 venv  # Create a virtual environment.
$ source venv/bin/activate    # Enter the virtual environment.
(venv)$ ./build.sh            # run build script
(venv)$ ls dist/              # check result wheel file
tbears-x.y.z-py3-none-any.whl

Installation

This chapter will explain how to install T-Bears on your system.

Requirements

ICON SCORE development and execution requires following environments :

  • OS: MacOS, Linux
    • Windows are not supported yet.
  • Python
    • Make Virtual Env for Python 3.6.5+ (recommended version, 3.7 is not supported)
    • check your python version
      $ python3 -V
      
    • IDE: Pycharm is recommended.

Softwares

Libraries

name description github
LevelDB ICON SCORE uses levelDB to store its states. LevelDB GitHub
libsecp256k1 ICON SCORE uses secp256k1 to sign and validate a digital signature. secp256k1 GitHub

Setup on MacOS

# install develop tools
$ brew install leveldb
$ brew install autoconf automake libtool pkg-config

# install RabbitMQ and start service
$ brew install rabbitmq
$ brew services start rabbitmq

# Create a working directory
$ mkdir work
$ cd work

# setup the python virtualenv development environment
$ pip3 install virtualenv
$ virtualenv -p python3 .
$ source bin/activate

# Install the ICON SCORE dev tools
(work) $ pip install tbears

Setup on Linux

# Install levelDB
$ sudo apt-get install libleveldb1 libleveldb-dev
# Install libSecp256k
$ sudo apt-get install libsecp256k1-dev

# install RabbitMQ and start service
$ sudo apt-get install rabbitmq-server

# Create a working directory
$ mkdir work
$ cd work

# Setup the python virtualenv development environment
$ virtualenv -p python3 .
$ source bin/activate

# Install the ICON SCORE dev tools
(work) $ pip install tbears