Skip to content

Commit 3d9b559

Browse files
committed
fix: Refactor documentation and code examples for iApp result handling
- Updated links in debugging and inputs/outputs guides to reflect new result decryption guide. - Added new guide on downloading and decrypting iApp results, detailing the process and providing code examples. - Removed outdated debug mode option from access management guide. - Streamlined input handling sections in execution guides, consolidating command-line argument examples. - Enhanced getting started guide with clearer prerequisites and installation instructions. - Removed unnecessary debug-related code snippets from the DataProtector documentation. - Updated iApp generator documentation to clarify project modes and removed debug mode references. - Improved formatting and clarity in the getting started guide for the iApp generator.
1 parent 3851738 commit 3d9b559

File tree

16 files changed

+89
-904
lines changed

16 files changed

+89
-904
lines changed

.vitepress/sidebar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ export function getSidebar() {
182182
link: '/guides/build-iapp/using-tdx',
183183
},
184184
{
185-
text: 'How to Get and Decrypt Results',
186-
link: '/guides/build-iapp/how-to-get-and-decrypt-results',
185+
text: 'Download and Decrypt Results',
186+
link: '/guides/build-iapp/download-and-decrypt-results',
187187
},
188188
{
189189
text: 'Debugging',

src/get-started/helloWorld/3-buildIApp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ const arbitrumSteps = [
489489
},
490490
{
491491
showAt: 13,
492-
question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7 on dockerhub',
492+
question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-ce3a01d9c5d7 on dockerhub',
493493
answer: '',
494494
showTyping: false,
495495
isComplete: true
@@ -558,7 +558,7 @@ const bellecourSteps = [
558558
},
559559
{
560560
showAt: 12,
561-
question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7 on dockerhub',
561+
question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-ce3a01d9c5d7 on dockerhub',
562562
answer: '',
563563
showTyping: false,
564564
isComplete: true
@@ -573,12 +573,12 @@ const bellecourSteps = [
573573
];
574574

575575
const arbitrumCompletionItems = [
576-
'└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7',
576+
'└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-ce3a01d9c5d7',
577577
'└ iApp address: 0x1f80DCebc2EAAff0Db7156413C43B7e88D189923'
578578
];
579579

580580
const bellecourCompletionItems = [
581-
'└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7',
581+
'└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-ce3a01d9c5d7',
582582
'└ iApp address: 0x1f80DCebc2EAAff0Db7156413C43B7e88D189923'
583583
];
584584
</script>

src/guides/build-iapp/build-&-deploy.md

Lines changed: 25 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,27 @@ iApp Generator handles all the low-level complexity for you.
3030

3131
Before getting started, make sure you have the following installed:
3232

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)
33+
<div class="flex flex-col gap-2 my-4 pl-0">
34+
<div class="flex items-center gap-4 text-left">
35+
<div class="flex items-center gap-1 flex-1 text-sm font-medium">
36+
📦 Node.js v20+
37+
</div>
38+
<a target="_blank" href="https://nodejs.org/en/" class="no-underline! text-sm ml-auto hover:underline!">Download →</a>
39+
</div>
40+
<div class="flex items-center gap-4 text-left">
41+
<div class="flex items-center gap-1 flex-1 text-sm font-medium">
42+
🐳 Docker installed
43+
</div>
44+
<a target="_blank" href="https://docker.com/" class="no-underline! text-sm ml-auto hover:underline!">Download →</a>
45+
</div>
46+
47+
<div class="flex items-center gap-4 text-left">
48+
<div class="flex items-center gap-1 flex-1 text-sm font-medium">
49+
🐳 DockerHub Account
50+
</div>
51+
<a target="_blank" href="https://hub.docker.com/" class="no-underline! text-sm ml-auto hover:underline!">Sign Up →</a>
52+
</div>
53+
</div>
3754

3855
## Installation
3956

@@ -220,88 +237,6 @@ specify your app version, and push both standard and TEE-compatible images:
220237
/>
221238
</template>
222239

223-
## Real Examples
224-
225-
Here are some real-world examples of iApp to help you understand how they work
226-
in practice.
227-
228-
### Email Notification iApp
229-
230-
This iApp lets you send updates to your contacts without ever seeing their email
231-
addresses, privacy is preserved by design.
232-
233-
::: code-group
234-
235-
```js [Node.js]
236-
/* User runs: "Send updates to my contacts about my project" */
237-
const contacts = loadProtectedData(); // User's protected contact list
238-
contacts.forEach((contact) => {
239-
sendEmail(contact, projectUpdateMessage);
240-
});
241-
// → Emails sent directly, you never see the addresses
242-
```
243-
244-
```python [Python]
245-
# User runs: "Send updates to my contacts about my project"
246-
contacts = load_protecteddata() # User's protected contact list
247-
for contact in contacts:
248-
send_email(contact, project_update_message)
249-
# → Emails sent directly, you never see the addresses
250-
```
251-
252-
:::
253-
254-
### Oracle Update iApp
255-
256-
This iApp securely updates a price oracle using private trading data, ensuring
257-
sensitive information stays confidential.
258-
259-
::: code-group
260-
261-
```js [Node.js]
262-
// User runs: "Update price oracle with my private trading data"
263-
const tradingData = loadProtectedData(); // User's protected trading history
264-
const averagePrice = calculateWeightedAverage(tradingData);
265-
updateOracleContract(averagePrice);
266-
// → Oracle updated with real data, trading history stays private
267-
```
268-
269-
```python [Python]
270-
# User runs: "Update price oracle with my private trading data"
271-
trading_data = load_protecteddata() # User's protected trading history
272-
average_price = calculate_weighted_average(trading_data)
273-
update_oracle_contract(average_price)
274-
# → Oracle updated with real data, trading history stays private
275-
```
276-
277-
:::
278-
279-
### Automated Transactions iApp
280-
281-
This iApp automates monthly payments using protected payment details, so
282-
financial information remains private.
283-
284-
::: code-group
285-
286-
```js [Node.js]
287-
// User runs: "Automate payments every month"
288-
const paymentInfo = loadProtectedData(); // User's payment details
289-
for (let month = 0; month < 12; month++) {
290-
processPayment(paymentInfo);
291-
}
292-
// → Payments processed, payment details stay private
293-
```
294-
295-
```python [Python]
296-
# User runs: "Automate payments every month"
297-
payment_info = load_protecteddata() # User's payment details
298-
for month in range(12):
299-
process_payment(payment_info)
300-
# → Payments processed, payment details stay private
301-
```
302-
303-
:::
304-
305240
<script setup>
306241
import CLIDemo from '@/components/CLIDemo.vue';
307242
import { computed } from 'vue';
@@ -377,7 +312,7 @@ const arbitrumSteps = [
377312
},
378313
{
379314
showAt: 13,
380-
question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7 on dockerhub',
315+
question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-ce3a01d9c5d7 on dockerhub',
381316
answer: '',
382317
showTyping: false,
383318
isComplete: true
@@ -446,7 +381,7 @@ const bellecourSteps = [
446381
},
447382
{
448383
showAt: 12,
449-
question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7 on dockerhub',
384+
question: 'Pushed TEE image bob/hello-world:0.0.1-tee-scone-5.9.1-v16-ce3a01d9c5d7 on dockerhub',
450385
answer: '',
451386
showTyping: false,
452387
isComplete: true
@@ -461,12 +396,12 @@ const bellecourSteps = [
461396
];
462397

463398
const arbitrumCompletionItems = [
464-
'└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7',
399+
'└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-ce3a01d9c5d7',
465400
'└ iApp address: 0x1f80DCebc2EAAff0Db7156413C43B7e88D189923'
466401
];
467402

468403
const bellecourCompletionItems = [
469-
'└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-debug-ce3a01d9c5d7',
404+
'└ Docker image: bob/hello-world:0.0.1-tee-scone-5.9.1-v16-ce3a01d9c5d7',
470405
'└ iApp address: 0x1f80DCebc2EAAff0Db7156413C43B7e88D189923'
471406
];
472407
</script>

src/guides/build-iapp/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,5 @@ Continue improving your iApp:
171171

172172
- **[Inputs and Outputs](/guides/build-iapp/inputs-and-outputs)** - Handle data
173173
in TEE
174-
- **[How to Get and Decrypt Results](/guides/build-iapp/how-to-get-and-decrypt-results)** -
174+
- **[How to Get and Decrypt Results](/guides/build-iapp/download-and-decrypt-results)** -
175175
Retrieve results

src/guides/build-iapp/how-to-get-and-decrypt-results.md renamed to src/guides/build-iapp/download-and-decrypt-results.md

Lines changed: 10 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: How to Get and Decrypt Results
33
description: Download and decrypt iApp execution results from completed tasks
44
---
55

6-
# 📦 How to Get and Decrypt Results
6+
# 📦 Download and Decrypt Results
77

88
**When an iApp execution completes, you need to retrieve and decrypt the
99
results.** This guide shows you how to download task results and decrypt them to
@@ -40,96 +40,32 @@ Deal (agreement between parties)
4040
- 📁 **Results contain** all files from `IEXEC_OUT` directory
4141
-**Available immediately** after task completion
4242

43-
## Downloading Results
43+
## Download & Decrypt Results
4444

45-
### Using iExec SDK CLI
46-
47-
**Get task information and download**:
48-
49-
```bash
50-
# Check task status and get result info
51-
iexec task show <taskId>
52-
53-
# Download encrypted result
54-
iexec task show <taskId> --download my-result
55-
56-
# Extract downloaded files
57-
unzip my-result.zip -d my-result/
58-
ls my-result/
59-
```
60-
61-
**Get task ID from deal**:
62-
63-
```bash
64-
# If you only have the deal ID
65-
iexec deal show <dealId>
66-
67-
# Lists all tasks in the deal with their IDs
68-
```
69-
70-
### Using DataProtector SDK
71-
72-
**Integrated download and decryption**:
45+
DataProtector provides methods to download and decrypt results from completed
46+
tasks. You can view the `taskId` in your
47+
[iExec Explorer](https://explorer.iex.ec/).
7348

7449
```ts twoslash
7550
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
7651

7752
const web3Provider = getWeb3Provider('PRIVATE_KEY');
7853
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
7954
// ---cut---
80-
// Get result from completed task
55+
// Get result from a completed task
8156
const result = await dataProtectorCore.getResultFromCompletedTask({
8257
taskId: '0x123abc...', // Your task ID
8358
});
8459

8560
console.log('Result downloaded and decrypted:', result);
8661
```
8762

88-
## Decrypting Results
63+
::: tip Info
8964

90-
### Automatic Decryption with DataProtector
91-
92-
**The easiest way** - decryption happens automatically:
93-
94-
```ts twoslash
95-
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
65+
The `processProtectedData` method will create a task and automatically download
66+
and decrypt the result.
9667

97-
const web3Provider = getWeb3Provider('PRIVATE_KEY');
98-
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
99-
// ---cut---
100-
// Execute and get results in one flow
101-
const processResponse = await dataProtectorCore.processProtectedData({
102-
protectedData: '0x123abc...',
103-
app: '0x456def...',
104-
});
105-
106-
console.log('Task ID:', processResponse.taskId);
107-
108-
// Get decrypted result
109-
const result = await dataProtectorCore.getResultFromCompletedTask({
110-
taskId: processResponse.taskId,
111-
});
112-
113-
// Result is automatically decrypted ArrayBuffer
114-
const resultText = new TextDecoder().decode(result.result);
115-
console.log('Decrypted result:', resultText);
116-
```
117-
118-
### Manual Decryption with CLI
119-
120-
**If you downloaded manually**:
121-
122-
```bash
123-
# Download the encrypted result
124-
iexec task show <taskId> --download my-result
125-
126-
# Decrypt using your wallet (must be the beneficiary)
127-
iexec result decrypt my-result.zip --force
128-
129-
# Extract decrypted files
130-
unzip decrypted-result.zip -d final-result/
131-
cat final-result/result.txt
132-
```
68+
:::
13369

13470
## Result File Structure
13571

src/guides/build-iapp/inputs-and-outputs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ save_report(report)
618618
Once your iApp completes execution, users can retrieve and decrypt the results:
619619

620620
**Learn how users get results**: Check our
621-
[How to Get and Decrypt Results](/guides/build-iapp/how-to-get-and-decrypt-results)
621+
[How to Get and Decrypt Results](/guides/build-iapp/download-and-decrypt-results)
622622
guide for the complete user workflow.
623623

624624
## What's Next?
@@ -631,7 +631,7 @@ Continue building with these guides:
631631
Control who can use your iApp
632632
- **[Debugging Your iApp](/guides/build-iapp/debugging)** - Troubleshoot
633633
execution issues
634-
- **[How to Get and Decrypt Results](/guides/build-iapp/how-to-get-and-decrypt-results)** -
634+
- **[How to Get and Decrypt Results](/guides/build-iapp/download-and-decrypt-results)** -
635635
User-side result handling
636636

637637
### Technical Deep Dive

src/guides/manage-data/manage-access.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,27 +79,6 @@ for detailed formatting instructions.
7979

8080
:::
8181

82-
### Debug Mode Option
83-
84-
Debug mode lets you test with debug iApp during development. As "debug" iApp
85-
don't have the same security standards, we recommend using this mode only during
86-
iApp development.
87-
88-
```ts twoslash
89-
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
90-
91-
const web3Provider = getWeb3Provider('PRIVATE_KEY');
92-
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
93-
// ---cut---
94-
95-
const protectedData = await dataProtectorCore.protectData({
96-
data: {
97-
98-
},
99-
allowDebug: true, // [!code focus]
100-
});
101-
```
102-
10382
## Grant Access
10483

10584
By default, your protected data is private. To let others use it, you need to

0 commit comments

Comments
 (0)