Skip to content
Merged

main #342

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions docs/colab/Jupyter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
id: "jupyter"
title: "Jupyter Notebook"
slug: "/"
sidebar_position: 0
---

## Log in

1. Open the [Marketplace](https://marketplace.superprotocol.com).

2. Click **Enter Marketplace** in the upper-right corner and log in using your preferred method.

## Get SPPI tokens

1. Click on your account name in the upper-right corner and select Account.

<img src={require('./images/1.png').default} width="auto" height="auto" border="1"/>
<br/>
<br/>

2. In the Account window, copy your Super Wallet address and share it with your contact in Super Protocol to receive SPPI tokens.

<img src={require('./images/2.png').default} width="auto" height="auto" border="1"/>
<br/>
<br/>

## Upload an IPYNB script or dataset

1. Open the [Marketplace Colab page](https://marketplace.superprotocol.com/order-create-colab).

2. Press **Upload Content**, select a file or folder, and click **Upload**. The uploaded content will be automatically encrypted and placed in a decentralized file storage (Storj).

3. Save the resulting TII.JSON file; it can be opened in any text editor. Inside:

- Encrypted data describing how to download and decrypt the uploaded content (objects `"encryptedResource"` and `"encryptedTRI"`).
- Hash of the uploaded content, calculated before the encryption.
- Restrictions on the computing device and the solution offer (i.e., Jupyter Notebook).

TII.JSON files are safe to share. The information about the uploaded content is encrypted with the public key of the specified confidential virtual machine (`"offerId": "10"`). Only this machine can decrypt it and then download and decrypt the content itself. The machine runs inside a Trusted Execution Environment with no external access.

## Deploy

1. Open the [Marketplace Colab page](https://marketplace.superprotocol.com/order-create-colab).

2. Press **Run Colab**.

3. Add the application and dataset TII.JSON files generated during the upload process.

4. Press **Run**. When the order is created, you will be redirected to the order page. Write down the order ID; you may need it later for verification.

5. Wait until the order is complete. For small files, it typically takes around 20 minutes, but the time can be significantly longer for large files. Use the **Extend Lease** button to add tokens to the order balance if the lease time is running out.

6. When the order is complete (Status: Done), press **Get Result** and download the TAR.GZ archive containing the order result.

7. Unzip the downloaded archive. The execution result is located in the `output` folder.

## Verify

1. [Download and set up SPCTL](/cli/) – the Super Protocol CLI tool.

2. Get the order report:


```shell
./spctl orders get-report <ORDER_ID> --save-to report.json
```

Replace `<ORDER_ID>` with your order ID, for example:

```shell
./spctl orders get-report 244834 --save-to report.json
```

The command will display and save the order report to the `report.json` file in the SPCTL directory. This report includes the certificate chain, order metadata, and validation result.

3. Ensure you see `Order report validation successful!` in the output.

4. Open `report.json` in a text editor and find two entries in the `“runtimeInfo”` array that start with `"type": "Data"`. For example:

```json
{
"type": "Data",
"size": 12901,
"hash": {
"algo": "sha256",
"hash": "8598805cd2136a4beff17559a7228854f6a8cc0b027856ea5c196fb8d0602501",
"encoding": "hex"
}
},
```

One such entry corresponds to the IPYNB script, the other to the dataset.

The hashes in these entries were calculated inside the TEE before the execution. Open the TII.JSON files in a text editor and compare the hashes within them with the hashes in the report. The match means the IPYNB script and the dataset are genuine and have not been altered.
8 changes: 8 additions & 0 deletions docs/colab/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
id: "docker"
title: "Docker Image"
slug: "/docker"
sidebar_position: 1
---

Work in progress...
Binary file added docs/colab/images/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/colab/images/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/marketplace/guides/log-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Both are free, popular, and non-custodial. Choose either and install its browser

:::important

Super Protocol is not affiliated with MetaMask or Trust Wallet in any way.
Super Protocol is not affiliated with MetaMask or Trust Wallet.

:::

Expand Down
14 changes: 14 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ const config = {
from: "/data-for-ai",
to: "/data-for-ai/overview/about",
},
/*{
from: "/colab",
to: "/colab/jupyter",
},*/
],
},
],
Expand All @@ -91,6 +95,16 @@ const config = {
rehypePlugins: [katex],
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "colab",
path: "./docs/colab",
routeBasePath: "/colab",
remarkPlugins: [math],
rehypePlugins: [katex],
},
],
],
presets: [
[
Expand Down
Loading