Skip to content

Commit d09a86e

Browse files
committed
Merge branch 'main' into feature/reapply-pr51-from-main
2 parents da72a88 + 1624d81 commit d09a86e

File tree

12 files changed

+187
-155
lines changed

12 files changed

+187
-155
lines changed

.vitepress/sidebar.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,12 @@ export function getSidebar() {
137137
link: '/guides/build-iapp/manage-access',
138138
},
139139
{
140-
text: 'Inputs and Outputs',
141-
link: '/guides/build-iapp/inputs-and-outputs',
140+
text: 'Inputs',
141+
link: '/guides/build-iapp/inputs',
142+
},
143+
{
144+
text: 'Outputs',
145+
link: '/guides/build-iapp/outputs',
142146
},
143147

144148
{

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,13 @@ for input parameters:
229229
- Add link to the new explorer feature Asset_Types in the guide =>
230230
`handle-schemas-dataset-types`
231231
- Add link to remix for deploying whitelist
232-
- Maybe split input and output in two diff sub section in build your iapp guide
233232
- Explorer l'intégration de codeSpace
234233
- Add a Development workflow section (1 - ProtectData, 2- ...)
235234
- Update context7 when doc will be deployed (Martin)
236235
- Check theGraph Images with design Team
237236
- Update the Dune Dashboard to the final version
238237
- Add new section in `iexec-explorer.md` file to talk about: available chain on
239238
the UI + SRLC/RLC on account section feature of the protocol
240-
- framework AI supporté
241239
- check glossary
242240
- migrate pay-per-task page into a guide
243241
- check pages (introduction & getting-started) for use-iapp guide
@@ -248,7 +246,7 @@ for input parameters:
248246
- Refactor "advanced" section in build-iapp
249247
- Rework src\get-started\protocol\iexec-doracle.md (transfer to guide or
250248
rewrite)
251-
- Talk about encrypting results in use-iapp
249+
- Talk about encrypting results in use-iapp (link in outputs, iapp generator...)
252250
- Rework src\get-started\protocol\oracle.md (transfer to guide or rewrite)
253251
- Talk about iApp secret
254252
- Improve Guide in build-iapp section - be more clear for builder ( how to

src/guides/build-iapp/advanced/access-confidential-assets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The SMS currently supports 3 types of secrets:
2929
This secret is directly accessible from the app as an environment variable.
3030
It is owned by the developer of the app. It can be any kind of data (API key,
3131
private key, token, ..) as long as it respects the size limit (max. 4096 kB).
32-
2. [Requester secrets](/guides/build-iapp/inputs-and-outputs#access-requester-secrets):
32+
2. [Requester secrets](/guides/build-iapp/inputs#access-requester-secrets):
3333
These secrets are directly accessible from the app as environment variables,
3434
as long as the requester has decided to share them with it. These secrets can
3535
be any kind of data as long as they respect the size limit (max. 4096 kB).
@@ -61,4 +61,4 @@ graph TD
6161
You now understand how these three kinds of confidential assets work on iExec,
6262
you can go one step further by learning how to manipulate them:
6363

64-
- [Access to a Protected Data](/guides/build-iapp/inputs-and-outputs)
64+
- [Access to a Protected Data](/guides/build-iapp/inputs#protected-data)

src/guides/build-iapp/advanced/build-your-first-tdx-iapp.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,9 @@ EXPERIMENTAL_TDX_APP=true iapp run <app-address>
276276

277277
- **[Debugging Your iApp](/guides/build-iapp/debugging)** - Troubleshoot
278278
execution issues and TDX-specific problems
279-
- **[Inputs and Outputs](/guides/build-iapp/inputs-and-outputs)** - Handle data
280-
in TEE environment with TDX
279+
- **[Inputs](/guides/build-iapp/inputs)** - Handle data inputs
280+
- **[Outputs](/guides/build-iapp/outputs)** - Handle data outputs in TEE
281+
environment with TDX
281282
- **[iApp Access Control and Pricing](/guides/build-iapp/manage-access)** -
282283
Configure access control for your TDX applications
283284

src/guides/build-iapp/advanced/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ You are now familiar with the following key iExec concepts for developers:
349349

350350
Continue with these guides:
351351

352-
- [Learn how to build your first condiential application running on iExec](/guides/build-iapp/advanced/build-your-first-sgx-iapp.md)
352+
- [Learn how to build your first confidential application running on iExec](/guides/build-iapp/advanced/build-your-first-sgx-iapp.md)
353353

354354
<script setup>
355355
import { computed } from 'vue';

src/guides/build-iapp/debugging.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,5 @@ except Exception as e:
169169

170170
Continue improving your iApp:
171171

172-
- **[Inputs and Outputs](/guides/build-iapp/inputs-and-outputs)** - Handle data
173-
in TEE
174-
- **[How to Get and Decrypt Results](/guides/build-iapp/inputs-and-outputs)** -
175-
Retrieve results
172+
- **[Inputs](/guides/build-iapp/inputs)** - Handle data inputs
173+
- **[Outputs](/guides/build-iapp/outputs)** - Handle data outputs in TEE

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

Lines changed: 8 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
title: Inputs and Outputs
2+
title: Inputs
33
description:
4-
Understand the different input types and output formats for iApp in the TEE
4+
Understand the different input types available to your iApp in the TEE
55
environment
66
---
77

8-
# 📥📤 Inputs and Outputs
8+
# 📥 Inputs
99

1010
**Your iApp runs inside a secure TEE environment with access to different types
1111
of inputs.** Understanding what data you can access, how to access it, and when
1212
to use each type is crucial for building effective privacy-preserving
1313
applications.
1414

15-
This guide covers all input types available to your iApp and how to generate
16-
proper outputs that users can retrieve and decrypt.
15+
This guide covers all input types available to your iApp and how to access them
16+
within the TEE environment.
1717

1818
## Two perspectives on inputs
1919

@@ -356,124 +356,6 @@ const processProtectedDataResponse =
356356
});
357357
```
358358

359-
## Creating Outputs
360-
361-
Your iApp must generate outputs in the `IEXEC_OUT` directory. **Every iApp must
362-
create a `computed.json` file** with metadata about the computation.
363-
364-
### Basic Output Structure
365-
366-
::: code-group
367-
368-
```python [Python]
369-
import os
370-
import json
371-
372-
# Get output directory
373-
iexec_out = os.environ['IEXEC_OUT']
374-
375-
# Create your result file
376-
result_data = {
377-
"analysis": "positive sentiment",
378-
"confidence": 0.92,
379-
"processed_at": "2024-01-15T10:30:00Z"
380-
}
381-
382-
# Save main result
383-
with open(f"{iexec_out}/result.json", 'w') as f:
384-
json.dump(result_data, f)
385-
386-
# REQUIRED: Create `computed.json` metadata
387-
computed_metadata = {
388-
"deterministic-output-path": f"{iexec_out}/result.json",
389-
"execution-timestamp": "2024-01-15T10:30:00Z",
390-
"app-version": "1.0.0"
391-
}
392-
393-
with open(f"{iexec_out}/computed.json", 'w') as f:
394-
json.dump(computed_metadata, f)
395-
```
396-
397-
```javascript [JavaScript]
398-
const fs = require('fs');
399-
const path = require('path');
400-
401-
// Get output directory
402-
const iexecOut = process.env.IEXEC_OUT;
403-
404-
// Create your result file
405-
const resultData = {
406-
analysis: 'positive sentiment',
407-
confidence: 0.92,
408-
processed_at: '2024-01-15T10:30:00Z',
409-
};
410-
411-
// Save main result
412-
fs.writeFileSync(
413-
path.join(iexecOut, 'result.json'),
414-
JSON.stringify(resultData, null, 2)
415-
);
416-
417-
// REQUIRED: Create computed.json metadata
418-
const computedMetadata = {
419-
'deterministic-output-path': path.join(iexecOut, 'result.json'),
420-
'execution-timestamp': '2024-01-15T10:30:00Z',
421-
'app-version': '1.0.0',
422-
};
423-
424-
fs.writeFileSync(
425-
path.join(iexecOut, 'computed.json'),
426-
JSON.stringify(computedMetadata, null, 2)
427-
);
428-
```
429-
430-
:::
431-
432-
### Output Best Practices
433-
434-
1. **Always create `computed.json`** - This is mandatory
435-
2. **Use descriptive filenames** - `analysis_result.json`, not `output.txt`
436-
3. **Include metadata** - Timestamps, versions, parameters used
437-
4. **Structure your data** - Use JSON for structured results
438-
5. **Keep files reasonable** - Large outputs increase retrieval time and may hit
439-
memory limits
440-
6. **Memory awareness** - TEE enclave memory is limited, avoid generating
441-
multi-GB outputs
442-
443-
### Example: Multi-file Output
444-
445-
```python
446-
import os
447-
import json
448-
449-
iexec_out = os.environ['IEXEC_OUT']
450-
451-
# Create multiple output files
452-
summary = {"total_processed": 1000, "success_rate": 0.95}
453-
with open(f"{iexec_out}/summary.json", 'w') as f:
454-
json.dump(summary, f)
455-
456-
# Create a detailed report
457-
with open(f"{iexec_out}/detailed_report.txt", 'w') as f:
458-
f.write("Detailed analysis results...\n")
459-
460-
# Create visualization data
461-
chart_data = {"labels": ["A", "B", "C"], "values": [10, 20, 30]}
462-
with open(f"{iexec_out}/chart_data.json", 'w') as f:
463-
json.dump(chart_data, f)
464-
465-
# Required metadata file
466-
computed = {
467-
"deterministic-output-path": f"{iexec_out}/summary.json",
468-
"additional-files": [
469-
f"{iexec_out}/detailed_report.txt",
470-
f"{iexec_out}/chart_data.json"
471-
]
472-
}
473-
with open(f"{iexec_out}/computed.json", 'w') as f:
474-
json.dump(computed, f)
475-
```
476-
477359
## Testing Inputs Locally
478360

479361
Use iApp Generator to test different input types:
@@ -595,13 +477,13 @@ save_report(report)
595477

596478
## What's Next?
597479

598-
**You now understand all input types and output requirements!**
480+
**You now understand all input types available to your iApp!**
599481

600482
Continue building with these guides:
601483

484+
- **[Outputs](/guides/build-iapp/outputs)** - Learn how to generate and
485+
structure your iApp outputs
602486
- **[App Access Control and Pricing](/guides/build-iapp/manage-access)** -
603487
Control who can use your iApp
604488
- **[Debugging Your iApp](/guides/build-iapp/debugging)** - Troubleshoot
605489
execution issues
606-
- **[How to Get and Decrypt Results](/guides/build-iapp/inputs-and-outputs)** -
607-
User-side result handling

0 commit comments

Comments
 (0)