diff --git a/.vitepress/sidebar.ts b/.vitepress/sidebar.ts index 4f0e1b1e..0fe974bd 100644 --- a/.vitepress/sidebar.ts +++ b/.vitepress/sidebar.ts @@ -153,10 +153,6 @@ export function getSidebar() { text: 'Quick Start', link: '/guides/build-iapp/advanced/quick-start', }, - { - text: 'Build your first application', - link: '/guides/build-iapp/advanced/build-your-first-iapp', - }, { text: 'Build your first SGX app', link: '/guides/build-iapp/advanced/build-your-first-sgx-iapp', @@ -202,7 +198,7 @@ export function getSidebar() { }, { text: 'Integrate Web3 Messaging', - link: '/guides/use-iapp/web3-messaging', + link: '/guides/use-iapp/integrate-web3-messaging', }, ], }, @@ -551,7 +547,6 @@ export function getSidebar() { }, { text: 'Workers & Workerpools', - collapsed: true, items: [ { text: 'Worker Quick Start', @@ -565,7 +560,6 @@ export function getSidebar() { }, { text: '🔒 TEE Technology', - collapsed: true, items: [ { text: 'Introduction to TEE Technologies', diff --git a/README.md b/README.md index 82e2cd8c..ebeadc58 100644 --- a/README.md +++ b/README.md @@ -226,11 +226,9 @@ for input parameters: ## TODO -- Adapt hardcoded address to feat with new contracts deployed on arbitrum - Add link to the new explorer feature Asset_Types in the guide => `handle-schemas-dataset-types` - Add link to remix for deploying whitelist -- complete `use-iapp` section - Maybe split input and output in two diff sub section in build your iapp guide - Explorer l'intégration de codeSpace - Add a Development workflow section (1 - ProtectData, 2- ...) @@ -239,25 +237,20 @@ for input parameters: - Update the Dune Dashboard to the final version - Add new section in `iexec-explorer.md` file to talk about: available chain on the UI + SRLC/RLC on account section feature of the protocol -- Update or add design illustrations based on the new design system -- Check how to pay guide to update with the launch on Arbitrum (RLC vs xRLC) - framework AI supporté - check glossary -- migrate github iexec SDK doc here - migrate pay-per-task page into a guide - check pages (introduction & getting-started) for use-iapp guide - Schema what is iexec to do and implement - Give recap of Workerpool address fo chains - Talk about ENS on Bellecour(it's not supported on arbitrum) -- Rework Advanced iApp building guides. (from "old" protocol doc) <<<<<<< HEAD - Talk about encrypting results in use-iapp - Refactor "advanced" section in build-iapp - Rework src\get-started\protocol\iexec-doracle.md (transfer to guide or rewrite) - Talk about encrypting results in use-iapp -- Refactor "advanced" section in build-iapp - Rework src\get-started\protocol\oracle.md (transfer to guide or rewrite) - Talk about iApp secret - Improve Guide in build-iapp section - be more clear for builder ( how to process process protectedData, clarify input-output guide) -- refactor iapp generator cli reference +- Add illustration in the different pages diff --git a/src/get-started/toolkit.md b/src/get-started/toolkit.md index f802948b..7435d657 100644 --- a/src/get-started/toolkit.md +++ b/src/get-started/toolkit.md @@ -5,6 +5,45 @@ description: Essential tools and resources for building on iExec # 🛠️ iExec Toolkit -This page is under development. +Build faster and smarter with our turnkey toolkit designed to streamline your +iExec development experience. - +## 🚀 iApp Generator + +The **iApp Generator** is your quick-start solution for creating iExec +confidential decentralized applications. Generate production-ready iApp with +just a few commands, let free your imagination. + +### Key Features + +- **Development templates** that simplify iApp development +- **Streamlined wallet management** for easy app deployment +- **Governance management** to control who accesses your app, when, and at what + price + +### Get Started + +Jump right into building with our comprehensive guide: +[Building Your iApp →](/references/iapp-generator/building-your-iexec-app.md) + +## 🔒 DataProtector-SDK + +The **DataProtector-SDK** provides a complete toolkit for managing confidential +data on iExec. Protect, share, and monetize your data by exposing the protected +asset type on the iExec protocol without revealing the actual value, allowing +users to pay for access. + +### Key Features + +- **Easy data protection** through SDK methods +- **Asset visualization** to easily view and explore protected asset types on + the iExec protocol +- **Content consumption** capabilities for accessing protected data through + confidential iExec applications (iApps) +- **Governance management** to control who accesses your data, when, and at what + price + +### Get Started + +Learn how to protect and manage your data: +[DataProtector Getting Started →](/references/dataProtector/getting-started.md) diff --git a/src/guides/build-iapp/advanced/build-your-first-iapp.md b/src/guides/build-iapp/advanced/build-your-first-iapp.md deleted file mode 100644 index ced98339..00000000 --- a/src/guides/build-iapp/advanced/build-your-first-iapp.md +++ /dev/null @@ -1,429 +0,0 @@ ---- -title: Build Your First iApp -description: - In this section we will show you how you can create an iApp over the iExec - infrastructure. ---- - -# Build your first iApp - -> In this section we will show you how you can create an iApp (iExec -> confidential application) over the iExec infrastructure. - -::: tip Prerequisites - -- [Docker](https://docs.docker.com/install/) 17.05 or higher on the daemon and - client. -- [Dockerhub](https://hub.docker.com/) account. -- [iExec SDK](https://www.npmjs.com/package/iexec) 8.0.0 or higher. -- [Quickstart](./quick-start.md) tutorial completed - -::: - -In this guide, we will prepare an iExec iApp based on an existing docker image -and we will run it on iExec decentralized infrastructure. - -## Understand what is an iExec decentralized application (iApp)? - -iExec leverage [Docker](https://www.docker.com/why-docker) containers to ensure -the execution of your application on a decentralized infrastructure. iExec -supports Linux-based docker images. - -### Why using Docker containers? - -- Docker Engine is the most **widely used** container engine. -- A Docker container image is a **standard** unit of software that packages up - code and all its dependencies so the application runs quickly and reliably - from one computing environment to another. This allows for computations to be - **run on any worker** connected to the decentralized infrastructure. -- Docker also enables the creation of new layers on top of existing images. This - allows for any iExec **apps to be easily built on top of existing docker - images**. - -### What kind of application can I build on iExec? - -Today you can run any application as a task. This means services are not -supported for now. - -## Build your iApp - -Create the folder tree for your application in `~/iexec-projects/`. - -```bash -cd ~/iexec-projects -mkdir hello-world-iapp -cd hello-world-iapp -mkdir src -touch Dockerfile -``` - -### Write the iApp - -::: warning - -For demo purposes, we omitted some development best practices in these examples. - -Make sure to check your field's best practices before going to production. - -::: - -The following examples only feature Javascript and Python use cases for -simplicity concerns but remember that you can run on iExec anything which is -Dockerizable. - -**Copy the following content** in `src/` . - -::: code-group - -```javascript [src/app.js] -const fsPromises = require('fs').promises; - -(async () => { - try { - const iexecOut = process.env.IEXEC_OUT; - // Do whatever you want (let's write hello world here) - const message = process.argv.length > 2 ? process.argv[2] : 'World'; - - const text = `Hello, ${message}!`; - console.log(text); - // Append some results in /iexec_out/ - await fsPromises.writeFile(`${iexecOut}/result.txt`, text); - // Declare everything is computed - const computedJsonObj = { - 'deterministic-output-path': `${iexecOut}/result.txt`, - }; - await fsPromises.writeFile( - `${iexecOut}/computed.json`, - JSON.stringify(computedJsonObj) - ); - } catch (e) { - console.log(e); - process.exit(1); - } -})(); -``` - -```python [src/app.py] -import os -import sys -import json - -iexec_out = os.environ['IEXEC_OUT'] - -# Do whatever you want (let's write hello world here) -text = 'Hello, {}!'.format(sys.argv[1] if len(sys.argv) > 1 else "World") -print(text) - -# Append some results in /iexec_out/ -with open(iexec_out + '/result.txt', 'w+') as fout: - fout.write(text) - -# Declare everything is computed -with open(iexec_out + '/computed.json', 'w+') as f: - json.dump({ "deterministic-output-path" : iexec_out + '/result.txt' }, f) -``` - -::: - -::: warning - -As a developer, make it a rule to never log sensitive information in your -application. Execution logs are accessible by: - -- worker(s) involved in the task -- the workerpool manager -- the requester of the task - -::: - -### Dockerize your iApp - -**Copy the following content** in `Dockerfile` . - -::: code-group - -```bash [Dockerfile for JavaScript] -FROM node:22-alpine3.21 -### install your dependencies if you have some -RUN mkdir /app && cd /app -COPY ./src /app -ENTRYPOINT [ "node", "/app/app.js"] -``` - -```bash [Dockerfile for Python] -FROM python:3.13.3-alpine3.21 -### install python dependencies if you have some -COPY ./src /app -ENTRYPOINT ["python3", "/app/app.py"] -``` - -::: - -Build the docker image. - -::: warning - -iExec expects your Docker container to be built for the `linux/amd64` platform. -However, if you develop on a **Mac** with Apple **M processor**, the platform is -`linux/arm64`, which is different. To prepare your application, you will need to -install `buildkit` and then prepare your docker image for both platforms. - -```bash -brew install buildkit -# ARM64 variant for local testing only -docker buildx build --platform linux/arm64 --tag /hello-world . -# AMD64 variant to deploy on iExec -docker buildx build --platform linux/amd64 --tag /hello-world . -``` - -::: - -```bash -docker build --tag hello-world . -``` - -::: tip - -`docker build` produce an image id, using `--tag ` option is a convenient -way to name the image to reuse it in the next steps. - -::: - -**Congratulations you built your first docker image for iExec!** - -## Test your iApp locally - -### Basic test - -Create local volumes to simulate input and output directories. - -```bash -mkdir -p ./tmp/iexec_in -mkdir -p ./tmp/iexec_out -``` - -Run your application locally \(container volumes bound with local volumes\). - -```bash -docker run --rm \ - -v ./tmp/iexec_in:/iexec_in \ - -v ./tmp/iexec_out:/iexec_out \ - -e IEXEC_IN=/iexec_in \ - -e IEXEC_OUT=/iexec_out \ - hello-world arg1 arg2 arg3 -``` - -::: tip Docker run \[options\] image \[args\] - -**docker run usage:** - -`docker run [OPTIONS] IMAGE [COMMAND] [ARGS...]` - -Use `[COMMAND]` and `[ARGS...]` to simulate the requester arguments - -**useful options for iExec:** - -`-v` : Bind mount a volume. Use it to bind input and output directories -(`/iexec_in` and `/iexec_out`) - -`-e`: Set environnement variable. Use it to simulate iExec Runtime variables - -::: - -### Test with input files - -Starting with the basic test you can simulate input files. - -For each input file: - -- Copy it in the local volume bound to `/iexec_in` . -- Add `-e IEXEC_INPUT_FILE_NAME_x=NAME` to docker run options \(`x` is the index - of the file starting by 1 and `NAME` is the name of the file\) - -Add `-e IEXEC_INPUT_FILES_NUMBER=n` to docker run options \(`n` is the total -number of input files\). - -Example with two inputs files: - -```bash -touch ./tmp/iexec_in/file1 && \ -touch ./tmp/iexec_in/file2 && \ -docker run \ - -v ./tmp/iexec_in:/iexec_in \ - -v ./tmp/iexec_out:/iexec_out \ - -e IEXEC_IN=/iexec_in \ - -e IEXEC_OUT=/iexec_out \ - -e IEXEC_INPUT_FILE_NAME_1=file1 \ - -e IEXEC_INPUT_FILE_NAME_2=file2 \ - -e IEXEC_INPUT_FILES_NUMBER=2 \ - hello-world \ - arg1 arg2 arg3 -``` - -## Test your iApp on iExec - -### Push your iApp to Dockerhub - -Login to your Dockerhub account. - -```bash -docker login -``` - -Tag your application image to push it to your dockerhub public repository. - -```bash -docker tag hello-world /hello-world:1.0.0 -``` - -::: warning - -replace `` with your docker user name - -::: - -Push the image to Dockerhub. - -```bash -docker push /hello-world:1.0.0 -``` - -**Congratulations, your iApp is ready to be deployed on iExec!** - -### Deploy your iApp on iExec - -You already learned how to deploy the default iApp on iExec in the -[previous tutorial](./quick-start.md). - -Go back to the `iexec-project` folder. - -```bash -cd ~/iexec-projects/ -``` - -You will need a few configurations in `iexec.json` to deploy your iApp: - -- Replace iApp **name** with your application name \(display only\) -- Replace iApp **multiaddr** with your iApp image download URI \(should looks - like `docker.io//hello-world:1.0.0`\) -- Replace iApp **checksum** with your application image checksum \(see tip - below\) - -::: info - -The checksum of your iApp is the sha256 digest of the docker image prefixed with -`0x` , you can use the following command to get it. - -```bash -docker pull /hello-world:1.0.0 | grep "Digest: sha256:" | sed 's/.*sha256:/0x/' -``` - -::: - -Deploy your iApp on iExec - -```bash twoslash -iexec app deploy --chain {{chainName}} -``` - -Verify the deployed iApp \(name, multiaddr, checksum, owner\) - -```bash twoslash -iexec app show --chain {{chainName}} -``` - -### Run your iApp on iExec - -```bash twoslash -iexec app run --chain {{chainName}} --workerpool {{workerpoolAddress}} --watch -``` - -::: info - -**Using arguments:** - -You can pass arguments to the iApp using `--args ` option. - -With `--args "dostuff --with-option"` the iApp will receive -`["dostuff", "--with-option"]` as process args. - -**Using input files:** - -You can pass input files to the iApp using `--input-files ` option. - -With -`--input-files https://example.com/file-A.txt,https://example.com/file-B.zip` -the iExec worker will download the files before running the iApp in `IEXEC_IN`, -and let the iApp access them through variables: - -- `file-A.txt` as`IEXEC_INPUT_FILE_NAME_1` -- `file-B.zip` as`IEXEC_INPUT_FILE_NAME_2` - -::: - -Once the run is completed copy the taskid from `iexec app run` output to -download and check the result - -```bash twoslash -iexec task show --chain {{chainName}} --download my-app-result \ - && unzip my-app-result.zip -d my-app-result -``` - -**Congratulations your iApp successfully ran on iExec!** - -## Manage your iApp's output - -iExec enables running apps producing output files, you will need a place for -storing your apps outputs. - -::: info - -iExec provides a default storage solution based on [IPFS](https://ipfs.io/). -This solution ensures your result to be publicly accessible through a -decentralized network. - -To ensure your business data remains secure and private, iExec offers optional -RSA result encryption and the ability to push results to private storage -providers. For more information, refer to `iexec storage --help` and -the[iExec SDK](https://github.com/iExecBlockchainComputing/iexec-sdk). - -::: - -## Access to iApp and task logs on iExec - -Sometimes things don't work out right the first time and you may need to -[Debug your tasks](/guides/build-iapp/debugging). - -## Publish your iApp on the iExec marketplace - -```bash twoslash -iexec app publish --chain {{chainName}} -``` - -**Congratulations your application is now available on iExec!** - -## What's next? - -In this tutorial you learned about the key concepts for building an iApp on -iExec: - -- iExec iApp inputs and outputs -- iExec iApp must produce a `computed.json` file \(required for the proof of - execution\) -- using docker to package your iApp with all its dependencies -- testing an iExec iApp locally -- publishing on dockerhub - - diff --git a/src/guides/build-iapp/advanced/build-your-first-sgx-iapp.md b/src/guides/build-iapp/advanced/build-your-first-sgx-iapp.md index 2a5b0867..1847a164 100644 --- a/src/guides/build-iapp/advanced/build-your-first-sgx-iapp.md +++ b/src/guides/build-iapp/advanced/build-your-first-sgx-iapp.md @@ -10,13 +10,6 @@ description: In this tutorial, you will learn how to build and run a Confidential Computing application with the Scone TEE framework. -::: warning - -Before going any further, make sure you managed to -[Build your first application](./build-your-first-iapp). - -::: - ::: tip Prerequisites: - [Docker](https://docs.docker.com/install/) 17.05 or higher on the daemon and @@ -41,14 +34,6 @@ docker login registry.scontain.com ## Prepare your application -Before going further, your `/hello-world:1.0.0` image built -previously is required. - -If you missed that part, please go back to -[Build your first application](./build-your-first-iapp). - -For this tutorial, you can reuse the same directory tree or create a new one. - To create a new directory tree, execute the following commands in `~/iexec-projects/`. @@ -62,6 +47,201 @@ touch sconify.sh chmod +x sconify.sh ``` +### Write the iApp logic + +Develop your code logic like the content below.The following examples only +feature Javascript and Python use cases for simplicity concerns but remember +that you can run on iExec anything which is Dockerizable. + +**Copy the following content** in `src/` . + +::: code-group + +```javascript [src/app.js] +const fsPromises = require('fs').promises; + +(async () => { + try { + const iexecOut = process.env.IEXEC_OUT; + // Do whatever you want (let's write hello world here) + const message = process.argv.length > 2 ? process.argv[2] : 'World'; + + const text = `Hello, ${message}!`; + console.log(text); + // Append some results in /iexec_out/ + await fsPromises.writeFile(`${iexecOut}/result.txt`, text); + // Declare everything is computed + const computedJsonObj = { + 'deterministic-output-path': `${iexecOut}/result.txt`, + }; + await fsPromises.writeFile( + `${iexecOut}/computed.json`, + JSON.stringify(computedJsonObj) + ); + } catch (e) { + console.log(e); + process.exit(1); + } +})(); +``` + +```python [src/app.py] +import os +import sys +import json + +iexec_out = os.environ['IEXEC_OUT'] + +# Do whatever you want (let's write hello world here) +text = 'Hello, {}!'.format(sys.argv[1] if len(sys.argv) > 1 else "World") +print(text) + +# Append some results in /iexec_out/ +with open(iexec_out + '/result.txt', 'w+') as fout: + fout.write(text) + +# Declare everything is computed +with open(iexec_out + '/computed.json', 'w+') as f: + json.dump({ "deterministic-output-path" : iexec_out + '/result.txt' }, f) +``` + +::: + +::: warning + +As a developer, make it a rule to never log sensitive information in your +application. Execution logs are accessible by: + +- worker(s) involved in the task +- the workerpool manager +- the requester of the task + +::: + +### Dockerize your iApp + +**Copy the following content** in `Dockerfile` . + +::: code-group + +```bash [Dockerfile for JavaScript] +FROM node:22-alpine3.21 +### install your dependencies if you have some +RUN mkdir /app && cd /app +COPY ./src /app +ENTRYPOINT [ "node", "/app/app.js"] +``` + +```bash [Dockerfile for Python] +FROM python:3.13.3-alpine3.21 +### install python dependencies if you have some +COPY ./src /app +ENTRYPOINT ["python3", "/app/app.py"] +``` + +::: + +Build the docker image. + +::: warning + +iExec expects your Docker container to be built for the `linux/amd64` platform. +However, if you develop on a **Mac** with Apple **M processor**, the platform is +`linux/arm64`, which is different. To prepare your application, you will need to +install `buildkit` and then prepare your docker image for both platforms. + +```bash +brew install buildkit +# ARM64 variant for local testing only +docker buildx build --platform linux/arm64 --tag /hello-world . +# AMD64 variant to deploy on iExec +docker buildx build --platform linux/amd64 --tag /hello-world . +``` + +::: + +```bash +docker build --tag hello-world . +``` + +::: tip + +`docker build` produce an image id, using `--tag ` option is a convenient +way to name the image to reuse it in the next steps. + +::: + +**Congratulations you built your first docker image for iExec!** + +## Test your iApp locally + +### Basic test + +Create local volumes to simulate input and output directories. + +```bash +mkdir -p ./tmp/iexec_in +mkdir -p ./tmp/iexec_out +``` + +Run your application locally \(container volumes bound with local volumes\). + +```bash +docker run --rm \ + -v ./tmp/iexec_in:/iexec_in \ + -v ./tmp/iexec_out:/iexec_out \ + -e IEXEC_IN=/iexec_in \ + -e IEXEC_OUT=/iexec_out \ + hello-world arg1 arg2 arg3 +``` + +::: tip Docker run \[options\] image \[args\] + +**docker run usage:** + +`docker run [OPTIONS] IMAGE [COMMAND] [ARGS...]` + +Use `[COMMAND]` and `[ARGS...]` to simulate the requester arguments + +**useful options for iExec:** + +`-v` : Bind mount a volume. Use it to bind input and output directories +(`/iexec_in` and `/iexec_out`) + +`-e`: Set environnement variable. Use it to simulate iExec Runtime variables + +::: + +### Test with input files + +Starting with the basic test you can simulate input files. + +For each input file: + +- Copy it in the local volume bound to `/iexec_in` . +- Add `-e IEXEC_INPUT_FILE_NAME_x=NAME` to docker run options \(`x` is the index + of the file starting by 1 and `NAME` is the name of the file\) + +Add `-e IEXEC_INPUT_FILES_NUMBER=n` to docker run options \(`n` is the total +number of input files\). + +Example with two inputs files: + +```bash +touch ./tmp/iexec_in/file1 && \ +touch ./tmp/iexec_in/file2 && \ +docker run \ + -v ./tmp/iexec_in:/iexec_in \ + -v ./tmp/iexec_out:/iexec_out \ + -e IEXEC_IN=/iexec_in \ + -e IEXEC_OUT=/iexec_out \ + -e IEXEC_INPUT_FILE_NAME_1=file1 \ + -e IEXEC_INPUT_FILE_NAME_2=file2 \ + -e IEXEC_INPUT_FILES_NUMBER=2 \ + hello-world \ + arg1 arg2 arg3 +``` + ## Build the TEE docker image Before wrapping your iExec confidential application with Scone, you need to @@ -85,7 +265,7 @@ We will use the following script to wrap the sconification process, copy the #!/bin/bash # Declare image related variables -IMG_FROM=/hello-world:1.0.0 +IMG_FROM=/hello-world IMG_TO=/tee-scone-hello-world:1.0.0 # Run the sconifier to build the TEE image based on the non-TEE image @@ -113,7 +293,7 @@ docker run -it --rm \ #!/bin/bash # Declare image related variables -IMG_FROM=/hello-world:1.0.0 +IMG_FROM=/hello-world IMG_TO=/tee-scone-hello-world:1.0.0 # Run the sconifier to build the TEE image based on the non-TEE image @@ -148,18 +328,13 @@ Run the `sconify.sh` script to build the Scone TEE application: Push your image on DockerHub: ```bash +docker login docker push /tee-scone-hello-world:1.0.0 ``` Congratulations, you just built your Scone TEE application. -## Test your iApp on iExec - -At this stage, your application is ready to be tested on iExec. The process is -similar to testing any type of application on the platform, with these minor -exceptions: - -### Deploy the TEE iApp on iExec +## Deploy the iApp TEE applications require some additional information to be filled in during deployment. @@ -194,13 +369,6 @@ Edit `iexec.json` and fill in the standard keys and the `mrenclave` object: ::: info -See -[Create your identity on the blockchain](./quick-start.md#create-your-identity-on-the-blockchain) -to retrieve `` value. - -See [Deploy your iApp on iExec](./build-your-first-iapp.md) to retrieve your -image ``. - Run your TEE image with `SCONE_HASH=1` to get the enclave fingerprint (mrenclave): @@ -216,9 +384,52 @@ Deploy the iApp with the standard command: iexec app deploy --chain {{chainName}} ``` -### Run the TEE iApp +You can check your deployed apps with their index, let's check your last +deployed app: + +```bash twoslash +iexec app show --chain arbitrum-mainnet +``` + +## Run the iApp + +iExec allows you to run applications on a decentralized infrastructure with +payment in **RLC** tokens. + +::: info + +To run an application you must have enough RLC staked on your iExec account to +pay for the computing resources. + +Your iExec account is managed by smart contracts \(and not owned by iExec\). + +When you request an execution the price for the task is locked from your +account's stake then transferred to accounts of the workers contributing to the +task \(read more about [Proof of Contribution](/protocol/proof-of-contribution) +protocol\). -Specify the tag `--tag tee,scone` in `iexec app run` command to run a tee iApp. +At any time you can: + +- view your balance + +```bash twoslash +iexec account show --chain arbitrum-mainnet +``` + +- deposit RLC from your wallet to your iExec Account + +```bash twoslash +iexec account deposit --chain arbitrum-mainnet +``` + +- withdraw RLC from your iExec account to your wallet \(only stake can be + withdrawn\) + +```bash twoslash +iexec account withdraw --chain arbitrum-mainnet +``` + +::: One last thing, in order to run a **TEE** iApp you will also need to select a workerpool, use the iexec workerpool `{{workerpoolAddress}}`. @@ -229,13 +440,111 @@ You are now ready to run the iApp iexec app run --chain {{chainName}} --tag tee,scone --workerpool {{workerpoolAddress}} --watch ``` +The execution of tasks on the iExec network is asynchronous by design. + +```mermaid +graph TD + Requester["Requester (or anyone)"] --> |"1 . Match compatible orders \n(request, application, dataset & workerpool orders) \n & Wait result" | Blockchain + Blockchain --> |2 . Notify new deal with tasks to compute| Scheduler + Worker --> |3 . Request new task to compute| Scheduler + Worker --> |4 . Run application| Application[Application image] + Worker --> |5.a. Push result| ResultStorage["Result Storage"] + Worker --> |5.b. Commit result proof| Blockchain + Workerpool --> |6 . Publish result link or callback| Blockchain + + subgraph Workerpool + Scheduler + Worker + Application + end +``` + +Guaranties about completion times (fast/slow) are available in the +[category section](/protocol/pay-per-task): + +- maximum deal/task time +- maximum computing time + +Once the task is completed copy the taskid from `iexec app run` output \(taskid +is a 32Bytes hexadecimal string\). + +Download the result of your task + +```bash twoslash +iexec task show --chain arbitrum-mainnet --download my-result +``` + +You can get your taskid with the command: + +```bash twoslash +iexec deal show --chain arbitrum-mainnet +``` + ::: info -Remember, you can access task and iApp logs by following the instructions on -page [Debug your tasks](/guides/build-iapp/debugging). +A task result is a zip file containing the output files of the application. ::: +[iexechub/python-hello-world](https://hub.docker.com/repository/docker/iexechub/python-hello-world) +produce an text file in `result.txt`. + +Let's discover the result of the computation. + +```bash +unzip my-result.zip -d my-result +cat my-result/result.txt +``` + +Congratulations! You successfully executed your application on iExec! + +## Publish your app on the iExec Marketplace + +Your application is deployed on iExec and you completed an execution on iExec. +For now, only you can request an execution of your application. The next step is +to publish it on the iExec Marketplace, making it available for anyone to use. + +As the owner of this application, you can define the conditions under which it +can be used + +::: info + +iExec uses orders signed by the resource owner's wallet to ensure resources +governance. + +The conditions to use an app are defined in the **apporder**. + +::: + +Publish a new apporder for your application. + +```bash twoslash +iexec app publish --chain arbitrum-mainnet +``` + +::: info + +`iexec app publish` command allows to define custom access rules to the app +\(run `iexec app publish --help` to discover all the possibilities\). + +You will learn more about orders management later, keep the apporder default +values for now. + +::: + +Your application is now available for everyone on iExec marketplace on the +conditions defined in apporder. + +You can check the published apporders for your app + +```bash twoslash +iexec orderbook app --chain arbitrum-mainnet +``` + +Congratulation you just created a decentralized application! Anyone can now +trigger an execution of your application on the iExec decentralized +infrastructure. + ## Next step? In this tutorial, you learned how to leverage your application with the power of @@ -244,7 +553,7 @@ may need to use some confidential data to get the full potential of the **Confidential Computing** paradigm. Check out next chapters to see how: - [Access confidential assets from your iApp](access-confidential-assets.md) -- [Protect the result](./protect-the-result.md) +- [Protect the result](/guides/build-iapp/advanced/protect-the-result.md)