Development tools and environment

Tools required to start developing contracts

Before we start with the actual development process, we need to ensure that we have the required tools at hand.

The following are the essentials that will be at the core of the development process of smart contracts using Ontology:

  • SmartX - Ontology's online smart contract IDE and debugger

  • Cyano wallet - Google Chrome extension

  • Explorer - Web based public tool used to track blockchain activity and transactions in general

Setting up the development environment can be a complicated and time-consuming process. That is the reason why we have tried to make this step as swift and convenient as possible. The tools are web based and are practically ready to use right away.

Firstly, for the sake of simplicity and convenience, we will be testing the contracts we develop on the test net, thereby eliminating the need of a private chain. A private blockchain network architecture can be set up just as easily on your local environment using Ontology's Punica suite, a set of development tools that allows for smart contract deployment and testing on the private net. Follow this link for more details.

The first tool that we need is a web browser. We recommend using Google Chrome for the entire process as Cyano wallet is a Chrome plugin.

Next, we need to install the Cyano wallet plugin in the browser. You can search "Cyano Wallet" in the Chrome store, or follow this link.

Once the installation completes and you launch the wallet for the first time, you will be prompted to login.

In case you already have a Cyano account, you can choose to login using your private key and mnemonics phrase.

If not, register a fresh account and proceed. Ensure that you save the private key and the mnemonics phrase in a secure location.

Once logged in, export the wallet to an external .dat file. This can be done by accessing settings by clicking on the cog in the top right corner. Ensure that it is stored securely. We will use this file later to work with SmartX.

Ensure that you change the network setting to TEST-NET, since we will be deploying and testing our logic on the test net.

Note: Deploying and testing smart contracts on the test net can be carried out without a MainNet ONT/ONG balance. But, to pay the gas cast of deploying a contract on the TestNet, you will still need a nominal TestNet ONG balance. The gas cost is calculated by taking the product of gas price and gas limit (gas price * gas limit). Test tokens can be applied for by following this link.

The IDE that we will be using is Ontology's SmartX, a browser-based development environment that supports Python, C#, and JavaScript(coming soon). We are going to take an in-depth look at the development process using Python, as far as this tutorial is concerned.

NeoVM serves as the execution engine for the programs written using Python in SmartX. The SmartX core integrates all of Ontology's APIs, and so all the different functions which allow us to perform blockchain related tasks can be used directly by importing the relevant API, which we will be discussing later.

Explorer is an online web based tool that can be used to track transaction and event related blockchain activity. It can be used to monitor both the TestNet and the MainNet using transaction hashes, ONT IDs, contract addresses, and even block height. It can be accessed by following this link.

Last updated