@@ -6,6 +6,12 @@ description:
6
6
7
7
# Create and Deploy an iApp
8
8
9
+ iApps (iExec Applications) are decentralized applications that run on the iExec
10
+ network. They leverage confidential computing to ensure data privacy and
11
+ security while providing scalable off-chain computation.
12
+
13
+ ## About iApp Generator
14
+
9
15
Bootstrap TEE-compatible applications in minutes without any hardcoding skills,
10
16
iApp Generator handles all the low-level complexity for you.
11
17
@@ -20,20 +26,254 @@ iApp Generator handles all the low-level complexity for you.
20
26
- ** Check and deploy iApps quickly** - iApp Generator checks that your iApp
21
27
complies with the iExec Framework and streamlines its deployment.
22
28
23
- ``` bash
24
- # Create your iApp (Python or Node.js supported)
25
- iapp init my-privacy-app
26
- cd my-privacy-app
29
+ ## Prerequisites
30
+
31
+ Before getting started, make sure you have the following installed:
32
+
33
+ - ** Node.js** (version 18 or higher) - [ Download here] ( https://nodejs.org/ )
34
+ - ** Docker** - [ Download here] ( https://www.docker.com/get-started )
35
+ - ** Docker Hub account** - [ Sign up here] ( https://hub.docker.com/ ) (required for
36
+ deployment)
37
+
38
+ ## Installation
39
+
40
+ First, install the iApp Generator CLI tool using your preferred package manager:
41
+
42
+ ::: code-group
43
+
44
+ ``` sh [npm]
45
+ npm install -g @iexec/iapp
46
+ ```
47
+
48
+ ``` sh [yarn]
49
+ yarn global add @iexec/iapp
50
+ ```
51
+
52
+ ``` sh [pnpm]
53
+ pnpm add -g @iexec/iapp
54
+ ```
27
55
28
- # Develop and test locally (simulates TEE environment)
29
- iapp test
30
- # Deploy to the network
31
- iapp deploy
56
+ ``` sh [bun]
57
+ bun add -g @iexec/iapp
32
58
```
33
59
34
- <div class =" bg-gradient-to-r from-blue-400/10 to-blue-400/5 rounded-[6px] p-4 border-l-4 border-blue-600 mb-6 " >
35
- <p class =" m-0! text-sm " ><strong >Note:</strong > iApp Generator currently supports Python and Node.js, but iApps can be built in any language that runs in Docker.</p >
36
- </div >
60
+ :::
61
+
62
+ ## Quick Start
63
+
64
+ Once installed, you can create and deploy your first iApp. The CLI will guide
65
+ you through an interactive setup process to configure your project name,
66
+ programming language, and template:
67
+
68
+ <CLIDemo
69
+ initialCommand="iapp init"
70
+ asciiText="iApp"
71
+ : steps ="[
72
+ {
73
+ showAt: 2,
74
+ completeAt: 4,
75
+ question: 'What is your project name? (A folder with this name will be created)',
76
+ answer: 'hello-world',
77
+ showTyping: true,
78
+ isComplete: false
79
+ },
80
+ {
81
+ showAt: 4,
82
+ completeAt: 6,
83
+ question: 'Which language do you want to use?',
84
+ answer: 'JavaScript',
85
+ options: [
86
+ { label: 'JavaScript', selected: true },
87
+ { label: 'Python', selected: false }
88
+ ] ,
89
+ highlighted: false,
90
+ isComplete: false
91
+ },
92
+ {
93
+ showAt: 6,
94
+ completeAt: 8,
95
+ question: 'What kind of project do you want to init?',
96
+ answer: 'Hello World',
97
+ options: [
98
+ { label: 'Hello World - iapp quick start', selected: true },
99
+ { label: 'advanced', selected: false }
100
+ ] ,
101
+ highlighted: false,
102
+ isComplete: false
103
+ }
104
+ ] "
105
+ : completionStep ="8"
106
+ : completionMessage ="'Generating your iApp...'"
107
+ : completionItems ="[
108
+ '📁 Created hello-world/',
109
+ '📄 Added package.json',
110
+ '🐳 Added Dockerfile',
111
+ '⚙️ Added iExec configuration'
112
+ ] "
113
+ : successMessage ="'Your iApp is ready!'"
114
+ />
115
+
116
+ After the interactive setup, continue with development and deployment:
117
+
118
+ ## Development and Testing
119
+
120
+ Navigate to your project and run tests locally to simulate the TEE environment.
121
+ The CLI will build a Docker image, run your app, and show you the results:
122
+
123
+ <CLIDemo
124
+ initialCommand="iapp test"
125
+ : steps ="[
126
+ {
127
+ showAt: 2,
128
+ question: 'No app secret is configured (from iapp.config.json)',
129
+ answer: '',
130
+ showTyping: false,
131
+ isComplete: true
132
+ },
133
+ {
134
+ showAt: 3,
135
+ question: 'App docker image built (sha256:9cc0de820aaaf8f86700a3ec4082fe69b9e9a48a117ebb0ade0d82d0879cbe41)',
136
+ answer: '',
137
+ showTyping: false,
138
+ isComplete: true
139
+ },
140
+ {
141
+ showAt: 4,
142
+ question: 'App docker image ran and exited successfully.',
143
+ answer: '',
144
+ showTyping: false,
145
+ isComplete: true
146
+ },
147
+ {
148
+ showAt: 5,
149
+ completeAt: 6,
150
+ question: 'Would you like to see the app logs? (12 lines)',
151
+ answer: 'no',
152
+ options: [
153
+ { label: 'yes', selected: false },
154
+ { label: 'no', selected: true }
155
+ ] ,
156
+ highlighted: false,
157
+ showTyping: false,
158
+ isComplete: false
159
+ },
160
+ {
161
+ showAt: 7,
162
+ question: 'Checked app output',
163
+ answer: '',
164
+ showTyping: false,
165
+ isComplete: true
166
+ },
167
+ {
168
+ showAt: 8,
169
+ completeAt: 10,
170
+ question: 'Would you like to see the result? (View ./output/)',
171
+ answer: 'yes',
172
+ options: [
173
+ { label: 'yes', selected: true },
174
+ { label: 'no', selected: false }
175
+ ] ,
176
+ highlighted: false,
177
+ showTyping: false,
178
+ isComplete: false
179
+ }
180
+ ] "
181
+ : completionStep ="11"
182
+ : completionMessage ="'📁 output directory content:'"
183
+ : completionItems ="[
184
+ '└ computed.json',
185
+ '└ result.txt'
186
+ ] "
187
+ : successMessage ="'hello world'"
188
+ : autoRestart ="true"
189
+ />
190
+
191
+ ## Deployment
192
+
193
+ After your tests pass and the package is built, you can deploy your iApp to a
194
+ supported network. During deployment, you'll enter your DockerHub credentials,
195
+ specify your app version, and push both standard and TEE-compatible images:
196
+
197
+ <CLIDemo
198
+ initialCommand="iapp deploy"
199
+ asciiText="Deploy"
200
+ : steps ="[
201
+ {
202
+ showAt: 2,
203
+ question: 'Using chain bellecour',
204
+ answer: '',
205
+ showTyping: false,
206
+ isComplete: true
207
+ },
208
+ {
209
+ showAt: 3,
210
+ question: 'Using saved walletPrivateKey (from iapp.config.json)',
211
+ answer: '',
212
+ showTyping: false,
213
+ isComplete: true
214
+ },
215
+ {
216
+ showAt: 4,
217
+ completeAt: 6,
218
+ question: 'What is your username on DockerHub? (It will be used to properly tag the Docker image)',
219
+ answer: 'bob',
220
+ showTyping: true,
221
+ isComplete: false
222
+ },
223
+ {
224
+ showAt: 6,
225
+ completeAt: 8,
226
+ question: 'What is your DockerHub access token?',
227
+ answer: '********************** ',
228
+ showTyping: true,
229
+ isComplete: false
230
+ },
231
+ {
232
+ showAt: 8,
233
+ completeAt: 10,
234
+ question: 'What is the version of your iApp?',
235
+ answer: '0.0.1',
236
+ showTyping: true,
237
+ isComplete: false
238
+ },
239
+ {
240
+ showAt: 10,
241
+ question: 'Docker image built (sha256: a53fc4c480f482c384a13266ea2cb6cc5572733c866c44a5f604f4bfab3a744a ) and tagged bob/hello-world:0.0.1',
242
+ answer: '',
243
+ showTyping: false,
244
+ isComplete: true
245
+ },
246
+ {
247
+ showAt: 11,
248
+ question: 'Pushed image bob/hello-world:0.0.1 on dockerhub',
249
+ answer: '',
250
+ showTyping: false,
251
+ isComplete: true
252
+ },
253
+ {
254
+ showAt: 12,
255
+ question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7 on dockerhub',
256
+ answer: '',
257
+ showTyping: false,
258
+ isComplete: true
259
+ },
260
+ {
261
+ showAt: 13,
262
+ question: 'TEE app deployed',
263
+ answer: '',
264
+ showTyping: false,
265
+ isComplete: true
266
+ }
267
+ ] "
268
+ : completionStep ="14"
269
+ : completionMessage ="'Deployment of your iApp completed successfully:'"
270
+ : completionItems ="[
271
+ '└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7',
272
+ '└ iApp address: 0x1f80DCebc2EAAff0Db7156413C43B7e88D189923'
273
+ ] "
274
+ : successMessage ="'Run iapp run 0x1f80DCebc2EAAff0Db7156413C43B7e88D189923 to execute your iApp on an iExec TEE worker'"
275
+ : autoRestart ="true"
276
+ />
37
277
38
278
## Real Examples
39
279
@@ -91,7 +331,7 @@ update_oracle_contract(average_price)
91
331
92
332
:::
93
333
94
- ** Automated Transactions iApp**
334
+ ### Automated Transactions iApp
95
335
96
336
This iApp automates monthly payments using protected payment details, so
97
337
financial information remains private.
@@ -116,3 +356,7 @@ for month in range(12):
116
356
```
117
357
118
358
:::
359
+
360
+ <script setup >
361
+ import CLIDemo from ' ../../components/CLIDemo.vue' ;
362
+ </script >
0 commit comments