Difficulty: beginner
Estimated Time: 5 minutes

iExec V1 Tutorial : Install and run your first Dapp

Iexec allows Ethereum developers to create applications that can be executed off-chain. This package brings all the tools to develop, deploy and execute Dapps on Ethereum and iexec. Using these tools, you will be able to deploy any legacy applications in the iexec infrastructure and execute them through calls to Ethereum smart contracts.

In this tutorial, you will learn how to install and use the iexec Software Development Kit (iexec-sdk).

You will create your first smart contract that does a very simple off-chain computation: compute the factorial function of an integer.

First, you will take the rôle of a Dapp Provider by deploying a smart contract on the Ethereum blockchain. You will learn the basic of the IexecOracleAPI that your contract must inherit. If desired, the dapp Provider can set a RLC price for the usage of his Dapp.

Then, you will take the rôle of a Dapp User and see how the smart contract can now interact with iexec oracle to launch off-chain computations on the decentralized Cloud. The dapp user will have to use his RLC token for this.

Let's get started!

[ INFO ] : Due to transactions delay on ethereum ropsten and rinkeby networks, you may have to wait few minutes between each steps of the scenario. The default network targeted by this tutorial is ropsten ( automatic faucet for ropsten). If you want to target rinkeby or kovan networks or if you need help, join us on our slack.

Expected duration to complete the full scenario :
Katacoda Hello World Scenario On Ropsten : 00:10:00 min to 00:30:00 min
Katacoda Hello World Scenario On Rinkeby : 00:05:00 min to 00:20:00 min

Scenario not active in Kovan network

Your tutorial is now finished.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

iExec Hello World

Step 1 of 3

Step 1 - Install iexec

Pre-requisite: You need to have node.js installed on your machine.

npm -g install iexec

Check iexec help:

iexec --help

Check iexec version:

iexec --version

Install and run your first application with iexec

For this tutorial, we'll work with the factorial function. Factorial is compute-intensive and thus better executed off-chain. The following command initializes a basic iexec Dapp template for you.

iexec init factorial

Your iexec Dapp is composed at the minimum of two parts:

  • an offchain app, which can be any kind of legacy application. The offchain app will be executed by the iexec decentralized cloud.
  • a smart contract that interfaces your iExec Dapp from Ethereum to the offchain app.

You will deploy those 2 parts in this tutorial, the Factorial off-chain app in the iExec network and the dapp smart contract in ethereum testnet.

Go into the created directory:

cd iexec-factorial