iExec RLC 백서

iExec RLC

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 12쪽 중 12쪽

ring The IPFS gateway URL used for content downloads. Mainly used for checking content uploaded on the IPFS network. Use this option if you want to use your own IPFS node for content downloads. If not provided, the default IPFS gateway provided by iExec will be used. ts const dataProtector = new IExecDataProtector ( web3Provider , { ipfsGateway : 'ipfs-gateway-url' , }); iexecOptions ​ Low level configuration options for iexec SDK, see iexec SDK documentation IExecConfigOptions for more details. ts const dataProtector = new IExecDataProtector ( web3Provider , { iexecOptions : { smsURL : 'sms-url' }, }); INFO @iexec/dataprotector uses Intel TDX to process protected data. Connect to the TDX SMS and use the TDX workerpool to configure the SDK: Browser ts import { IExecDataProtector } from '@iexec/dataprotector' ; const web3Provider = window . ethereum ; // Instantiate dataProtector connected to the TDX SMS const dataProtector = new IExecDataProtector ( web3Provider , { iexecOptions : { smsURL : 'https://sms.labs.iex.ec' , }, }); ## /references/iapp-generator iApp Generator ​ Here's the tool, what it does, and how to use it. iApp Generator is a CLI that builds apps running inside TEEs. You write code, iExec handles the confidential computing setup. What is iApp Generator? ​ iApp Generator builds confidential applications. Your code runs in Intel TDX Trust Domains where data stays private during processing. What iApp Generator Provides ​ ✅ Project scaffolding - Complete iApp structure ready to deploy ✅ Local testing - Debug and iterate quickly in simulation mode ✅ One-click deployment - Deploy to TEE workers with a single command ✅ Input/output handling - Seamless integration with protected data Quick Start Path ​ 1. Learn the Concepts ​ Start here to understand what iApp are and how they work: iApp - Core concepts and TEE overview Getting Started - Your first iApp in 15 minutes Building Your iApp - Complete development guide 2. Master the Development Workflow ​ Once you've built your first iApp, level up with these practical guides: Inputs - Handle data inputs Outputs - Handle data outputs flow in TEE environment Debugging Your iApp - Troubleshoot execution issues App Access Control and Pricing - Control who can use your iApp 3. Explore Advanced Features ​ Ready for production? Dive into specialized topics: Build Intel TDX iApp - TDX with traditional deployment and iApp Generator technology Complete Guides Overview - All development guides in one place Why Choose iApp Generator? ​ Privacy without infrastructure overhead ​ Your code runs in Intel TDX Trust Domains. Even the worker running your app can't see what's happening inside. You build, iExec handles the TEE complexity ​ Write normal application code. iApp Generator handles secure deployment, worker coordination, and result encryption. Runs everywhere TEEs exist ​ Deploy across Intel-enabled workers globally. No server management, no cloud provider lock-in. Complete toolkit ​ Development, testing, deployment, and execution - everything included in one CLI. Ready to Build? ​ Start with the basics and work your way up to advanced privacy-preserving applications: Quick Path Getting Started - Build your first iApp (15 minutes) Inputs - Handle data inputs Outputs - Handle data outputs properly Debugging - Fix issues quickly App Access Control - Go to production Need Help? ​ Complete Guides - All development guides iExec Discord - Community support Ready to revolutionize privacy in computing? Your first privacy-preserving application is just a few commands away! 🚀 ## /references/iapp-generator/building-your-iexec-app Build your iApp ​ 📋 Prerequisites Before building your iApp, make sure you have the required tools installed. See the Getting Started guide for detailed prerequisites and installation instructions. Initialize your iApp ​ The iApp (iExec App) Generator command-line tool simplifies the setup of your iApp by guiding you through a step-by-step initialization process. This ensures your iApp is correctly configured and compatible with iExec's confidential computing environment. Define your project ​ Terminal $ iapp init _ _ (_) / \ _ __ _ __ | | / _ \ | '_ \| '_ \ | |/ ___ \| |_) | |_) | |_/_/ \_\ .__/| .__/ |_| |_| Follow the prompts to specify: Project name – Creates a folder for your project files. Language – Choose between JavaScript, Python, etc. Project mode – Choose Basic (Hello-World setup) or Advanced mode. Configure ​ You'll set up: Arguments (Args) – Public parameters for your iApp. Input Files – Files dynamically downloaded during execution. These can come from a specific URL . Requester Secrets – Confidential authentication strings. Protected Data – Encrypted data accessible only inside the TEE. App Secret – Immutable secret provisioned by the iApp owner. For more details and to learn how to use them in your application, refer here Inputs . Build your iApp ​ After initialization, the following essential files and directories are generated: iapp.config.json src/app.js (JavaScript) or src/app.py (Python) Dockerfile Directories: input/ output/ cache/ To modify your main application logic open: sh src/app.js # For JavaScript src/app.py # For Python INFO 💡 The src/ directory contains the core logic of your iApp. Implement your algorithms and data processing here. CLI Commands Reference ​ iapp init ​ Purpose : Initialize a new iApp project Usage : iapp init What it does : Creates project structure, configuration files, and basic templates through interactive prompts. iapp test ​ Purpose : Test your iApp locally before deployment Usage : iapp test [options] Options : -v, --version [boolean] – Show version number --args <string> – Arguments accessible inside the iApp (use quotes to group) --protectedData <string> – Specify the protected data mock name (default or custom via iapp mock ) --inputFile <string> – One or multiple input files (public URLs) available inside the iApp at $IEXEC_INPUT_FILE_NAME_* --requesterSecret <array> – Key-value requester secrets ( index=value ) available inside the iApp at $IEXEC_REQUESTER_SECRET_* iapp deploy ​ Purpose : Deploy your iApp to the iExec network Usage : iapp deploy [options] Options : --chain <string> – Specify the blockchain network for deployment (e.g., arbitrum-mainnet , arbitrum-sepolia-testnet ) iapp run <iAppAddress> ​ Purpose : Execute your deployed iApp on a worker node Usage : iapp run <iAppAddress> [options] Positional arguments : <iAppAddress> – Address of the deployed iApp to run Options : --args <string> – Arguments accessible inside the iApp (use quotes to group) --protectedData <string> – Specify the protected data mock name (default or custom via iapp mock ) --inputFile <string> – One or multiple input files (public URLs) available inside the iApp at $IEXEC_INPUT_FILE_NAME_* --requesterSecret <array> – Key-value requester secrets ( index=value ) available inside the iApp at $IEXEC_REQUESTER_SECRET_* --chain <string> – Specify the blockchain network to run the iApp on (e.g., arbitrum-mainnet , arbitrum-sepolia-testnet ) iapp debug <taskId> ​ Purpose : Retrieve detailed execution logs from worker nodes Usage : iapp debug <taskId> [options] Positional arguments : <taskId> – The ID of the task to debug Options : --chain <string> – Specify the blockchain network of the task (e.g., arbitrum-mainnet , arbitrum-sepolia-testnet ) iapp mock <inputType> ​ Purpose : Create a mocked input for testing Usage : iapp mock <inputType> [options] Positional arguments : <inputType> – Type of input to mock [choices: "protectedData"] iapp wallet <action> ​ Purpose : Manage wallet-related operations Usage : iapp wallet <action> [options] Positional arguments : <action> – Import a new wallet or select one from the keystore [choices: "import", "select"] Next Steps ​ Your iApp is now running on iExec! Once your application is stable and functional , you can learn how to manage access to your iApp ## /references/iapp-generator/deserializer Deserialize a ProtectedData ​ If you want to build your own iApp (iExec TEE Dapp), you may need to access protected data that your wallet and iApp are authorized to use. To achieve this, you must deserialize the content of the protected data with the expected data schema. To simplify this process, you can use the lightweight utility package, @iexec/dataprotector-deserializer , in your iApp. This package streamlines the deserialization of protected data, making it easy for you to access and use the information securely. Overview ​ This deserializer is built on the Borsh technical specification . iExec developed this JavaScript library to simplify deserialization in your iApp built with JavaScript. WARNING If you want to build your iApp in another language, you need to know how to deserialize a protected data. Under the hood, protected data are zip files replicating the tree structure of the original data object. iExec's protocol stores each value in a dedicated file, the system stores binary values as is while it handles boolean, numbers, and strings serialized with Borsh. To access a value from a protected data, your app will need to unzip the iExec dataset file at $IEXEC_IN/$IEXEC_DATASET_FILENAME . Then for 'bool' , 'f64' , 'i128' or 'string' types, use the Borsh deserialization specification to recover the original value. Borsh has implementations in various languages , check your favorite one. Prerequisites ​ Before getting started, ensure that you have the following installed on your system: - Node.js version 14 or higher - NPM (Node.js package manager) Installation ​ npm yarn pnpm bun sh npm install @iexec/dataprotector-deserializer sh yarn add @iexec/dataprotector-deserializer sh pnpm add @iexec/dataprotector-deserializer sh bun add @iexec/dataprotector-deserializer Instantiate SDK ​ NodeJS ts import { IExecDataProtectorDeserializer } from '@iexec/dataprotector-deserializer' ; const deserializer = new IExecDataProtectorDeserializer (); ## /references/iapp-generator/deserializer/getValue getValue ​ Method to deserialize a value given a provided type. Usage ​ NodeJS ts const value1 = await deserializer . getValue ( 'path.to.value1' , 'bool' ); const value2 = await deserializer . getValue ( 'path.to.value2' , 'string' ); Parameters ​ ts import { IExecDataProtectorDeserializer } from '@iexec/dataprotector-deserializer' ; path ​ string The path of the value inside the protected data that you want to deserialize. NodeJS ts const value1 = await deserializer . getValue ( 'path.to.value1' , 'bool' ); type ​ string Type of the desired data. The supported types are: bool | f64 | i128 | bigint | string | Uint8Array | boolean (legacy schema) | number (legacy schema) NodeJS ts const value1 = await deserializer . getValue ( 'path.to.value1' , 'bool' ); Return Value ​ The recovered original value.
프로젝트로 돌아가기