Skip to content

Commit 6a0dae4

Browse files
committed
docs: Refactor iApp guides for improved clarity and structure
- Enhanced the 'Build and Test an iApp' and 'Deploy and Run an iApp' guides by breaking long lines in descriptions for better readability. - Removed the outdated 'Run an iApp' and 'Run iApp with Inputs' guides to streamline documentation. - Updated descriptions and sections to improve clarity and consistency across the guides.
1 parent d523212 commit 6a0dae4

File tree

6 files changed

+334
-943
lines changed

6 files changed

+334
-943
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
title: Build and Test an iApp
33
description:
4-
Learn how to build, test, and package your iExec application using the iApp Generator CLI tool
4+
Learn how to build, test, and package your iExec application using the iApp
5+
Generator CLI tool
56
---
67

78
# Build and Test an iApp

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
22
title: Deploy and Run an iApp
33
description:
4-
Deploy your iApp to supported networks and learn how to execute it using the iApp Generator CLI
4+
Deploy your iApp to supported networks and learn how to execute it using the
5+
iApp Generator CLI
56
---
67

78
# Deploy and Run an iApp
89

9-
It's time to run your iApp! After building and testing, you'll need to deploy it to a supported network and then execute it.
10+
It's time to run your iApp! After building and testing, you'll need to deploy it
11+
to a supported network and then execute it.
1012

1113
## Deploy your iApp
1214

@@ -40,7 +42,11 @@ specify your app version, and push both standard and TEE-compatible images:
4042
/>
4143
</template>
4244

43-
Now that your iApp has been deployed on the iExec protocol, you can navigate to the `cache` folder to see your deployments saved. A file named `deployments.json` in the folder corresponding to your target network will be created containing each deployment made on this network. These files will help you easily track each deployment per network.
45+
Now that your iApp has been deployed on the iExec protocol, you can navigate to
46+
the `cache` folder to see your deployments saved. A file named
47+
`deployments.json` in the folder corresponding to your target network will be
48+
created containing each deployment made on this network. These files will help
49+
you easily track each deployment per network.
4450

4551
Here is an example:
4652

@@ -96,7 +102,12 @@ for developers who have built their own iApp.
96102
/>
97103
</template>
98104

99-
Now that you have run your iApp on the iExec protocol, you can navigate to the `cache` folder to see your runs saved. A file named `runs.json` in the folder corresponding to your target network will be created containing each run made on this network. These files will help you easily track each run per network. Use the [iExec Explorer](/guides/tooling-and-explorers/iexec-explorer) to retrieve more data about your tasks.
105+
Now that you have run your iApp on the iExec protocol, you can navigate to the
106+
`cache` folder to see your runs saved. A file named `runs.json` in the folder
107+
corresponding to your target network will be created containing each run made on
108+
this network. These files will help you easily track each run per network. Use
109+
the [iExec Explorer](/guides/tooling-and-explorers/iexec-explorer) to retrieve
110+
more data about your tasks.
100111

101112
Here is an example:
102113

@@ -116,7 +127,8 @@ Here is an example:
116127
## Next Steps
117128

118129
- Learn how to [manage access to your iApp](/guides/build-iapp/manage-access)
119-
- Discover [debugging techniques](/guides/build-iapp/debugging) for troubleshooting
130+
- Discover [debugging techniques](/guides/build-iapp/debugging) for
131+
troubleshooting
120132

121133
<script setup>
122134
import CLIDemo from '@/components/CLIDemo.vue';
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
title: Run iApp with ProtectedData
3+
description:
4+
Learn how to run iApp with encrypted protected data, arguments, and input files using the DataProtector toolkit for secure data processing
5+
---
6+
7+
# 📥 Run iApp with a ProtectedData
8+
9+
When an iApp requires additional data or parameters to function, you can provide
10+
various types of inputs to customize its behavior and enable processing. This
11+
guide covers all the different ways to run an iApp with inputs using the
12+
DataProtector turnkey toolkit.
13+
14+
## Possible Inputs
15+
16+
iExec supports several types of inputs for iApp executions:
17+
18+
1. **Protected Data**: Encrypted data processed within the TEE
19+
2. **Arguments**: Command-line arguments passed to the application
20+
3. **Input Files**: URLs to public files that the app can download
21+
4. **Secrets**: Sensitive data like API keys stored securely
22+
23+
## Adding Protected Data
24+
25+
When working with protected data that contains multiple files, you can specify
26+
which file to process.
27+
28+
```ts twoslash
29+
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
30+
31+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
32+
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
33+
// ---cut---
34+
// Process protected data with specific path
35+
const result = await dataProtectorCore.processProtectedData({
36+
protectedData: '0x123abc...',
37+
app: '0x456def...',
38+
path: 'data/input.csv',
39+
});
40+
```
41+
42+
The `processProtectedData` function will automatically download and decrypt the
43+
results for you. Nevertheless, if you want to retrieve results from a completed
44+
task, you can do so as follows:
45+
46+
```ts twoslash
47+
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
48+
49+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
50+
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
51+
const taskId = '0x7ac398...';
52+
53+
// ---cut---
54+
// Retrieve the result
55+
const taskResult = await dataProtectorCore.getResultFromCompletedTask({
56+
taskId: taskId,
57+
});
58+
```
59+
60+
## Adding Command-Line Arguments
61+
62+
Command-line arguments are passed as a string to the iApp and are visible on the
63+
blockchain.
64+
65+
```ts twoslash
66+
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
67+
68+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
69+
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
70+
// ---cut---
71+
// Process protected data with arguments
72+
const result = await dataProtectorCore.processProtectedData({
73+
protectedData: '0x123abc...',
74+
app: '0x456def...',
75+
args: '--input-path data/input.csv --output-format json --verbose',
76+
});
77+
```
78+
79+
## Adding Input Files
80+
81+
Input files are URLs to public files that the iApp can download during
82+
execution.
83+
84+
```ts twoslash
85+
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
86+
87+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
88+
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
89+
// ---cut---
90+
// Process protected data with input files
91+
const result = await dataProtectorCore.processProtectedData({
92+
protectedData: '0x123abc...',
93+
app: '0x456def...',
94+
inputFiles: [
95+
'https://raw.githubusercontent.com/user/repo/main/config.json',
96+
'https://example.com/public-data.csv',
97+
],
98+
});
99+
```
100+
101+
## Adding Secrets
102+
103+
Secrets are sensitive data like API keys, passwords, or tokens that are stored
104+
securely and made available to the iApp as environment variables.
105+
106+
```ts twoslash
107+
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
108+
109+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
110+
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
111+
// ---cut---
112+
// Process protected data with secrets
113+
const result = await dataProtectorCore.processProtectedData({
114+
protectedData: '0x123abc...',
115+
app: '0x456def...',
116+
secrets: {
117+
1: 'openai-api-key',
118+
2: 'database-password',
119+
},
120+
});
121+
```
122+
123+
## Next Steps
124+
125+
Now that you understand how to add inputs to iApp executions:
126+
127+
- Check out our
128+
[How to Pay for Executions](/guides/use-iapp/how-to-pay-executions) guide

0 commit comments

Comments
 (0)