Skip to content

Commit d9c98db

Browse files
committed
refactor(docs): consolidate iApp usage guides by removing outdated ProtectedData references and updating sidebar links
1 parent dfd592c commit d9c98db

File tree

3 files changed

+37
-231
lines changed

3 files changed

+37
-231
lines changed

.vitepress/sidebar.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,8 @@ export function getSidebar() {
197197
link: '/guides/use-iapp/how-to-pay-executions',
198198
},
199199
{
200-
text: 'Run iApp with ProtectedData',
201-
link: '/guides/use-iapp/run-iapp-with-ProtectedData',
202-
},
203-
{
204-
text: 'Run iApp without ProtectedData',
205-
link: '/guides/use-iapp/run-iapp-without-ProtectedData',
200+
text: 'Run iApp',
201+
link: '/guides/use-iapp/run-iapp',
206202
},
207203
{
208204
text: 'Integrate Web3 Messaging',

src/guides/use-iapp/run-iapp-without-ProtectedData.md

Lines changed: 0 additions & 202 deletions
This file was deleted.

src/guides/use-iapp/run-iapp-with-ProtectedData.md renamed to src/guides/use-iapp/run-iapp.md

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: Run iApp with ProtectedData
2+
title: Run iApp
33
description:
44
Learn how to run iApp with encrypted protected data, arguments, and input
5-
files using the DataProtector toolkit for secure data processing
5+
files using the iApp Generator toolkit
66
---
77

8-
# 📥 Run iApp with a ProtectedData
8+
# 📥 Run iApp
99

1010
When running an iApp, you can use multiple types of inputs. While ProtectedData
1111
is not mandatory to run an iApp, it's a powerful input type that allows you to
@@ -14,39 +14,51 @@ inputs that come directly from you (the requester) and can change between each
1414
execution: Arguments, Input Files, and Secrets. These non-persistent inputs are
1515
perfect for customizing the iApp's behavior for each specific run.
1616

17+
```ts twoslash
18+
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
19+
20+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
21+
const iappGenerator = new IExecIApp(web3Provider);
22+
// ---cut---
23+
// Process protected data with specific path
24+
const result = await iappGenerator.runIApp({
25+
iapp: '0x456def...',
26+
});
27+
```
28+
1729
## Adding Protected Data
1830

1931
When working with protected data that contains multiple files, you can specify
2032
which file to process.
2133

2234
```ts twoslash
23-
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
35+
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
2436

2537
const web3Provider = getWeb3Provider('PRIVATE_KEY');
26-
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
38+
const iappGenerator = new IExecIApp(web3Provider);
2739
// ---cut---
2840
// Process protected data with specific path
29-
const result = await dataProtectorCore.processProtectedData({
41+
const result = await iappGenerator.runIApp({
42+
iapp: '0x456def...',
3043
protectedData: '0x123abc...',
31-
app: '0x456def...',
3244
path: 'data/input.csv',
3345
});
3446
```
3547

36-
The `processProtectedData` function will automatically download and decrypt the
48+
The `runIApp` function will automatically download and decrypt the
3749
results for you. Nevertheless, if you want to retrieve results from a completed
3850
task, you can do so as follows:
3951

4052
```ts twoslash
41-
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
53+
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
4254

4355
const web3Provider = getWeb3Provider('PRIVATE_KEY');
44-
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
56+
const iappGenerator = new IExecIApp(web3Provider);
4557
const taskId = '0x7ac398...';
4658

4759
// ---cut---
4860
// Retrieve the result
49-
const taskResult = await dataProtectorCore.getResultFromCompletedTask({
61+
const taskResult = await iappGenerator.getResultFromCompletedTask({
5062
taskId: taskId,
5163
});
5264
```
@@ -57,15 +69,15 @@ Command-line arguments are passed as a string to the iApp and are visible on the
5769
blockchain.
5870

5971
```ts twoslash
60-
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
72+
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
6173

6274
const web3Provider = getWeb3Provider('PRIVATE_KEY');
63-
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
75+
const iappGenerator = new IExecIApp(web3Provider);
6476
// ---cut---
6577
// Process protected data with arguments
66-
const result = await dataProtectorCore.processProtectedData({
78+
const result = await iappGenerator.runIApp({
79+
iapp: '0x456def...',
6780
protectedData: '0x123abc...',
68-
app: '0x456def...',
6981
args: '--input-path data/input.csv --output-format json --verbose',
7082
});
7183
```
@@ -76,15 +88,15 @@ Input files are URLs to public files that the iApp can download during
7688
execution.
7789

7890
```ts twoslash
79-
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
91+
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
8092

8193
const web3Provider = getWeb3Provider('PRIVATE_KEY');
82-
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
94+
const iappGenerator = new IExecIApp(web3Provider);
8395
// ---cut---
8496
// Process protected data with input files
85-
const result = await dataProtectorCore.processProtectedData({
97+
const result = await iappGenerator.runIApp({
98+
iapp: '0x456def...',
8699
protectedData: '0x123abc...',
87-
app: '0x456def...',
88100
inputFiles: [
89101
'https://raw.githubusercontent.com/user/repo/main/config.json',
90102
'https://example.com/public-data.csv',
@@ -98,15 +110,15 @@ Secrets are sensitive data like API keys, passwords, or tokens that are stored
98110
securely and made available to the iApp as environment variables.
99111

100112
```ts twoslash
101-
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
113+
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
102114

103115
const web3Provider = getWeb3Provider('PRIVATE_KEY');
104-
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
116+
const iappGenerator = new IExecIApp(web3Provider);
105117
// ---cut---
106118
// Process protected data with secrets
107-
const result = await dataProtectorCore.processProtectedData({
119+
const result = await iappGenerator.runIApp({
120+
iapp: '0x456def...',
108121
protectedData: '0x123abc...',
109-
app: '0x456def...',
110122
secrets: {
111123
1: 'openai-api-key',
112124
2: 'database-password',

0 commit comments

Comments
 (0)