GITBOOK-604: Fix subgraph python scripts
BIN
.gitbook/assets/C2D High Level Architecture.jpg
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
.gitbook/assets/DDO Flow.jpg
Normal file
After Width: | Height: | Size: 163 KiB |
BIN
.gitbook/assets/DataNFT and Datatoken Flow.jpg
Normal file
After Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 463 KiB After Width: | Height: | Size: 463 KiB |
BIN
.gitbook/assets/OP High Level Architecture.jpg
Normal file
After Width: | Height: | Size: 234 KiB |
BIN
.gitbook/assets/architecture (2).png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
.gitbook/assets/datanft-and-datatoken.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
.gitbook/assets/ddo-flow.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
.gitbook/assets/feature-compute@2x.webp
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
.gitbook/assets/feature-datascience@2x.webp
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
.gitbook/assets/feature-marketplaces@2x.webp
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
.gitbook/assets/new-ramp-on-crypto-ramp-off.webp
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
.gitbook/assets/ocean-jelly-hyperrealistic.jpeg
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
.gitbook/assets/use-case (1) (1).png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
.gitbook/assets/use-case (1).png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
.gitbook/assets/v4-contracts.png
Normal file
After Width: | Height: | Size: 96 KiB |
@ -6,7 +6,7 @@ coverY: 0
|
||||
|
||||
# 📊 Data Science
|
||||
|
||||
<figure><img src="../.gitbook/assets/gif/my-data.gif" alt="" width="360"><figcaption><p>Ocean Protocol - Built to protect your precious.</p></figcaption></figure>
|
||||
<figure><img src="../.gitbook/assets/gif/my-data (1).gif" alt="" width="360"><figcaption><p>Ocean Protocol - Built to protect your precious.</p></figcaption></figure>
|
||||
|
||||
### Why should data scientists use Ocean Protocol?
|
||||
|
||||
@ -22,10 +22,9 @@ Ocean Protocol is built for data scientists to **monetize data effectively and**
|
||||
|
||||
### How to design a ML system using Ocean Protocol?
|
||||
|
||||
The first step is to tokenize data into data NFTs and datatokens on the blockchain. We offer a no-code way to tokenize data via the [Ocean Market](https://market.oceanprotocol.com). But we also offer code options for data scientists to use the [Ocean.py](../developers/ocean.py/) and [Ocean.js](../developers/ocean.js/) libraries. Data scientists can then build sophisticated ML systems on top of the tokenized data by using composable Ocean Protocol tools. ML models can use a variety of Ocean smart contracts, including Ocean's [Compute-to-Data](../developers/compute-to-data/), to build model outputs all the way to the last-mile delivery for businesses.
|
||||
The first step is to tokenize data into data NFTs and datatokens on the blockchain. We offer a no-code way to tokenize data via the [Ocean Market](https://market.oceanprotocol.com). But we also offer code options for data scientists to use the [Ocean.py](../developers/ocean.py) and [Ocean.js](../developers/ocean.js) libraries. Data scientists can then build sophisticated ML systems on top of the tokenized data by using composable Ocean Protocol tools. ML models can use a variety of Ocean smart contracts, including Ocean's [Compute-to-Data](../developers/compute-to-data/), to build model outputs all the way to the last-mile delivery for businesses.
|
||||
|
||||
### **Key Links for Data Scientists:**
|
||||
|
||||
* Learn the difference between Ocean Protocol [data NFTs and datatokens](../developers/contracts/datanft-and-datatoken.md), the two types of tokenized data assets you need to start building your ML systems.
|
||||
* Discover Ocean's [Compute-to-Data](../developers/compute-to-data/) engine that can help you to solve the difficult problem of selling algorithmic compute jobs on your datasets without actually revealing the contents of the algorithm & dataset to the consumer.
|
||||
|
||||
|
@ -19,9 +19,11 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
#### Curl Example
|
||||
|
||||
```
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/ddo/did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
@ -55,9 +57,11 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
#### Curl Example
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/metadata/did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
@ -130,6 +134,7 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
#### Curl Example
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/query' \
|
||||
--header 'Content-Type: application/json' \
|
||||
@ -139,6 +144,7 @@ curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquari
|
||||
}
|
||||
}'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
@ -173,11 +179,13 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
#### Curl Example
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/query/api/v1/aquarius/assets/ddo/validate' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '<json_body>'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
@ -245,11 +253,13 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
#### Curl Example
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/triggerCaching' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '<json_body>'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
|
@ -16,7 +16,7 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
Example response:
|
||||
|
||||
```
|
||||
```json
|
||||
{ "246": true, "3": true, "137": true,
|
||||
"2021000": true, "4": true, "1": true,
|
||||
"56": true, "80001": true, "1287": true
|
||||
@ -25,9 +25,11 @@ Example response:
|
||||
|
||||
#### Curl Example
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/chains/list'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
@ -54,15 +56,17 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
Example response:
|
||||
|
||||
```
|
||||
```json
|
||||
{"last_block": 25198729}
|
||||
```
|
||||
|
||||
#### Curl Example
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/chains/status/137'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
|
@ -15,7 +15,7 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
Example response:
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
"plugin": "elasticsearch",
|
||||
"software": "Aquarius",
|
||||
|
@ -145,7 +145,7 @@ First we are going to create a new file called .env in the root of your reposito
|
||||
|
||||
Copy and paste the following into the file:
|
||||
|
||||
```
|
||||
```bash
|
||||
|
||||
NEXT_PUBLIC_MARKET_FEE_ADDRESS="0x123abc"
|
||||
NEXT_PUBLIC_PUBLISHER_MARKET_ORDER_FEE="0.01"
|
||||
|
@ -11,7 +11,7 @@ All that’s left is for you to host your data marketplace and start sharing it
|
||||
|
||||
To host your data marketplace, you need to run the build command:
|
||||
|
||||
```
|
||||
```bash
|
||||
npm run build:static
|
||||
```
|
||||
|
||||
@ -19,17 +19,17 @@ This takes a few minutes to run. While this is running, you can get prepared to
|
||||
|
||||
Open up a new terminal window and run the following command to install surge:
|
||||
|
||||
```
|
||||
```bash
|
||||
npm install --global surge
|
||||
```
|
||||
|
||||
When this is complete, navigate back to the terminal window that is building your finished data marketplace. Once the build is completed, enter the following commands to enter the public directory and host it:
|
||||
|
||||
```
|
||||
```bash
|
||||
cd out
|
||||
```
|
||||
|
||||
```
|
||||
```bash
|
||||
surge
|
||||
```
|
||||
|
||||
|
@ -28,7 +28,7 @@ Installing the dependencies is a vital step for running the market. It’s a sup
|
||||
|
||||
Enter the following command to install the dependencies:
|
||||
|
||||
```
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
@ -38,7 +38,7 @@ This command will take a few minutes to complete and you’ll see some warnings
|
||||
|
||||
At this point, you are ready to run your data marketplace for the first time. This is another straightforward step that requires just one command:
|
||||
|
||||
```
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
|
@ -1,41 +1,34 @@
|
||||
---
|
||||
title: Compute Options
|
||||
section: developers
|
||||
description: >-
|
||||
Specification of compute options for assets in Ocean Protocol.
|
||||
description: Specification of compute options for assets in Ocean Protocol.
|
||||
---
|
||||
|
||||
## Compute Options
|
||||
# Compute Options
|
||||
|
||||
### Compute Options
|
||||
|
||||
An asset with a service of `type` `compute` has the following additional attributes under the `compute` object. This object is required if the asset is of `type` `compute`, but can be omitted for `type` of `access`.
|
||||
|
||||
| Attribute | Type | Description |
|
||||
| -------- | -------- | -------- |
|
||||
| **`allowRawAlgorithm`*** | `boolean` | If `true`, any passed raw text will be allowed to run. Useful for an algorithm drag & drop use case, but increases risk of data escape through malicious user input. Should be `false` by default in all implementations. |
|
||||
| **`allowNetworkAccess`*** | `boolean` | If `true`, the algorithm job will have network access. |
|
||||
| **`publisherTrustedAlgorithmPublishers`*** | Array of `string` | If not defined, then any published algorithm is allowed. If empty array, then no algorithm is allowed. If not empty any algo published by the defined publishers is allowed. |
|
||||
| **`publisherTrustedAlgorithms`*** | Array of `publisherTrustedAlgorithms` | If not defined, then any published algorithm is allowed. If empty array, then no algorithm is allowed. Otherwise only the algorithms defined in the array are allowed. (see below). |
|
||||
<table><thead><tr><th width="404.3333333333333">Attribute</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>allowRawAlgorithm</code></strong>*</td><td><code>boolean</code></td><td>If <code>true</code>, any passed raw text will be allowed to run. Useful for an algorithm drag & drop use case, but increases risk of data escape through malicious user input. Should be <code>false</code> by default in all implementations.</td></tr><tr><td><strong><code>allowNetworkAccess</code></strong>*</td><td><code>boolean</code></td><td>If <code>true</code>, the algorithm job will have network access.</td></tr><tr><td><strong><code>publisherTrustedAlgorithmPublishers</code></strong>*</td><td>Array of <code>string</code></td><td>If not defined, then any published algorithm is allowed. If empty array, then no algorithm is allowed. If not empty any algo published by the defined publishers is allowed.</td></tr><tr><td><strong><code>publisherTrustedAlgorithms</code></strong>*</td><td>Array of <code>publisherTrustedAlgorithms</code></td><td>If not defined, then any published algorithm is allowed. If empty array, then no algorithm is allowed. Otherwise only the algorithms defined in the array are allowed. (see below).</td></tr></tbody></table>
|
||||
|
||||
\* Required
|
||||
|
||||
## Trusted Algorithms
|
||||
### Trusted Algorithms
|
||||
|
||||
The `publisherTrustedAlgorithms` is an array of objects with the following structure:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
| ------------------------------ | -------- | ----------------------------------------------------------- |
|
||||
| **`did`** | `string` | The DID of the algorithm which is trusted by the publisher. |
|
||||
| **`filesChecksum`** | `string` | Hash of algorithm's files (as `string`). |
|
||||
| **`containerSectionChecksum`** | `string` | Hash of algorithm's image details (as `string`). |
|
||||
<table><thead><tr><th width="289.3333333333333">Attribute</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>did</code></strong></td><td><code>string</code></td><td>The DID of the algorithm which is trusted by the publisher.</td></tr><tr><td><strong><code>filesChecksum</code></strong></td><td><code>string</code></td><td>Hash of algorithm's files (as <code>string</code>).</td></tr><tr><td><strong><code>containerSectionChecksum</code></strong></td><td><code>string</code></td><td>Hash of algorithm's image details (as <code>string</code>).</td></tr></tbody></table>
|
||||
|
||||
To produce `filesChecksum`, call the Provider FileInfoEndpoint with parameter withChecksum = True. If algorithm has multiple files, `filesChecksum` is a concatenated string of all files checksums (ie: checksumFile1+checksumFile2 , etc)
|
||||
|
||||
To produce `containerSectionChecksum`:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```js
|
||||
sha256(algorithm_ddo.metadata.algorithm.container.entrypoint + algorithm_ddo.metadata.algorithm.container.checksum);
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
<details>
|
||||
|
||||
@ -89,7 +82,7 @@ Example:
|
||||
|
||||
</details>
|
||||
|
||||
## Consumer Parameters
|
||||
### Consumer Parameters
|
||||
|
||||
Sometimes, the asset needs additional input data before downloading or running a Compute-to-Data job. Examples:
|
||||
|
||||
@ -98,15 +91,15 @@ Sometimes, the asset needs additional input data before downloading or running a
|
||||
|
||||
The `consumerParameters` is an array of objects. Each object defines a field and has the following structure:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
| ----------------- | -------------------------------- | -------------------------------------------------------------------------- |
|
||||
| **`name`*** | `string` | The parameter name (this is sent as HTTP param or key towards algo) |
|
||||
| **`type`*** | `string` | The field type (text, number, boolean, select) |
|
||||
| **`label`*** | `string` | The field label which is displayed |
|
||||
| **`required`*** | `boolean` | If customer input for this field is mandatory. |
|
||||
| **`description`*** | `string` | The field description. |
|
||||
| **`default`*** | `string`, `number`, or `boolean` | The field default value. For select types, `string` key of default option. |
|
||||
| **`options`** | Array of `option` | For select types, a list of options. |
|
||||
| Attribute | Type | Description |
|
||||
| ------------------- | -------------------------------- | -------------------------------------------------------------------------- |
|
||||
| **`name`**\* | `string` | The parameter name (this is sent as HTTP param or key towards algo) |
|
||||
| **`type`**\* | `string` | The field type (text, number, boolean, select) |
|
||||
| **`label`**\* | `string` | The field label which is displayed |
|
||||
| **`required`**\* | `boolean` | If customer input for this field is mandatory. |
|
||||
| **`description`**\* | `string` | The field description. |
|
||||
| **`default`**\* | `string`, `number`, or `boolean` | The field default value. For select types, `string` key of default option. |
|
||||
| **`options`** | Array of `option` | For select types, a list of options. |
|
||||
|
||||
\* Required
|
||||
|
||||
@ -168,12 +161,7 @@ Algorithms will have access to a JSON file located at `/data/inputs/algoCustomDa
|
||||
<details>
|
||||
|
||||
<summary>Key Value Example</summary>
|
||||
```json
|
||||
{
|
||||
"hometown": "São Paulo",
|
||||
"age": 10,
|
||||
"developer": true,
|
||||
"languagePreference": "nodejs"
|
||||
}
|
||||
```
|
||||
|
||||
\`\`\`json { "hometown": "São Paulo", "age": 10, "developer": true, "languagePreference": "nodejs" } \`\`\`
|
||||
|
||||
</details>
|
@ -23,9 +23,11 @@ When creating an algorithm asset in Ocean Protocol, the additional `algorithm` o
|
||||
|
||||
<summary>Environment Object Example</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{ "algorithm": { "container": { "entrypoint": "node $ALGO", "image": "node", "tag": "latest" } } }
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
||||
@ -257,6 +259,7 @@ The `container` object has the following attributes defining the Docker image fo
|
||||
|
||||
<summary>Algorithm Metadata Example</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"metadata": {
|
||||
@ -279,5 +282,6 @@ The `container` object has the following attributes defining the Docker image fo
|
||||
}
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
@ -7,17 +7,17 @@ description: >-
|
||||
|
||||
# Data NFTs and Datatokens
|
||||
|
||||
<figure><img src="../../.gitbook/assets/architecture/dataNFT_datatokens_overview.png" alt=""><figcaption><p>Data NFTs and Datatokens</p></figcaption></figure>
|
||||
<figure><img src="../../.gitbook/assets/DataNFT&Datatokens.png" alt=""><figcaption><p>Data NFTs and Datatokens</p></figcaption></figure>
|
||||
|
||||
In summary: A [**data NFT**](data-nfts.md) serves as a **representation of the copyright** or exclusive license for a data asset on the blockchain, known as the "[**base IP**](../../discover/glossary.md#base ip)". **Datatokens**, on the other hand, function as a crucial mechanism for **decentralized access** to data assets.
|
||||
In summary: A [**data NFT**](data-nfts.md) serves as a **representation of the copyright** or exclusive license for a data asset on the blockchain, known as the "\[**base IP**]\(../../discover/glossary.md#base ip)". **Datatokens**, on the other hand, function as a crucial mechanism for **decentralized access** to data assets.
|
||||
|
||||
For a specific data NFT, multiple ERC20 datatoken contracts can exist. Here's the main concept: Owning 1.0 datatokens grants you the ability to **consume** the corresponding dataset. Essentially, it acts as a **sub-license** from the [base IP](../../discover/glossary.md#base ip), allowing you to utilize the dataset according to the specified license terms (when provided by the publisher). License terms can be established with a "good default" or by the Data NFT owner.
|
||||
For a specific data NFT, multiple ERC20 datatoken contracts can exist. Here's the main concept: Owning 1.0 datatokens grants you the ability to **consume** the corresponding dataset. Essentially, it acts as a **sub-license** from the \[base IP]\(../../discover/glossary.md#base ip), allowing you to utilize the dataset according to the specified license terms (when provided by the publisher). License terms can be established with a "good default" or by the Data NFT owner.
|
||||
|
||||
The choice to employ the ERC20 fungible token standard for datatokens is logical, as licenses themselves are fungible. This standard ensures compatibility and interoperability of datatokens with ERC20-based wallets, decentralized exchanges (DEXes), decentralized autonomous organizations (DAOs), and other relevant platforms. Datatokens can be transferred, acquired through marketplaces or exchanges, distributed via airdrops, and more.
|
||||
|
||||
You can [publish](../../discover/glossary.md#to publish) a data NFT initially with no ERC20 datatoken contracts. This means you simply aren’t ready to grant access to your data asset yet (sub-license it). Then, you can publish one or more ERC20 datatoken contracts against the data NFT. One datatoken contract might grant consume rights for **1 day**, another for **1 week**, etc. Each different datatoken contract is for **different** license terms.
|
||||
You can \[publish]\(../../discover/glossary.md#to publish) a data NFT initially with no ERC20 datatoken contracts. This means you simply aren’t ready to grant access to your data asset yet (sub-license it). Then, you can publish one or more ERC20 datatoken contracts against the data NFT. One datatoken contract might grant consume rights for **1 day**, another for **1 week**, etc. Each different datatoken contract is for **different** license terms.
|
||||
|
||||
For a more comprehensive exploration of intellectual property and its practical connections with ERC721 and ERC20, you can read the blog post written by [Trent McConaghy](http://www.trent.st/), co-founder of Ocean Protocol. It delves into the subject matter in detail and provides valuable insights.
|
||||
For a more comprehensive exploration of intellectual property and its practical connections with ERC721 and ERC20, you can read the blog post written by [Trent McConaghy](http://www.trent.st/), co-founder of Ocean Protocol. It delves into the subject matter in detail and provides valuable insights.
|
||||
|
||||
{% embed url="https://blog.oceanprotocol.com/nfts-ip-1-practical-connections-of-erc721-with-intellectual-property-dc216aaf005d" %}
|
||||
|
||||
@ -32,9 +32,9 @@ What happends under the hood? 🤔
|
||||
|
||||
<figure><img src="../../.gitbook/assets/architecture/publish_dataNFT_detailed_flow.png" alt=""><figcaption><p>Data NFT & Datatokens flow</p></figcaption></figure>
|
||||
|
||||
We have some awesome hands-on experience when it comes to publishing a data NFT and minting datatokens. 
|
||||
We have some awesome hands-on experience when it comes to publishing a data NFT and minting datatokens.
|
||||
|
||||
* Publish using [ocean.py ](../ocean.py/publish-flow.md)
|
||||
* Publish using [ocean.py](../ocean.py/publish-flow.md)
|
||||
* Publish using [ocean.js](../ocean.js/publish.md)
|
||||
|
||||
### Other References
|
||||
@ -43,4 +43,3 @@ We have some awesome hands-on experience when it comes to publishing a data NFT
|
||||
* [Data & NFTs 2: Leveraging ERC20 Fungibility](https://blog.oceanprotocol.com/nfts-ip-2-leveraging-erc20-fungibility-bcee162290e3)
|
||||
* [Data & NFTs 3: Combining ERC721 & ERC20](https://blog.oceanprotocol.com/nfts-ip-3-combining-erc721-erc20-b69ea659115e)
|
||||
* [Fungibility sightings in NFTs](https://blog.oceanprotocol.com/on-difficult-to-explain-fungibility-sightings-in-nfts-26bc18620f70)
|
||||
|
||||
|
@ -9,8 +9,6 @@ description: >-
|
||||
|
||||
# DDO Specification
|
||||
|
||||
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
DDO
|
||||
@ -32,18 +30,17 @@ Services ||--|{ ConsumerParameters : contains
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Required Attributes
|
||||
|
||||
A DDO in Ocean has these required attributes:
|
||||
|
||||
<table><thead><tr><th width="203.33333333333331">Attribute</th><th width="226">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>@context</code></strong></td><td>Array of <code>string</code></td><td>Contexts used for validation.</td></tr><tr><td><strong><code>id</code></strong></td><td><code>string</code></td><td>Computed as <code>sha256(address of ERC721 contract + chainId)</code>.</td></tr><tr><td><strong><code>version</code></strong></td><td><code>string</code></td><td>Version information in <a href="https://semver.org">SemVer</a> notation referring to this DDO spec version, like <code>4.1.0</code>.</td></tr><tr><td><strong><code>chainId</code></strong></td><td><code>number</code></td><td>Stores chainId of the network the DDO was published to.</td></tr><tr><td><strong><code>nftAddress</code></strong></td><td><code>string</code></td><td>NFT contract linked to this asset</td></tr><tr><td><strong><code>metadata</code></strong></td><td><a href="#metadata">Metadata</a></td><td>Stores an object describing the asset.</td></tr><tr><td><strong><code>services</code></strong></td><td><a href="#services">Services</a></td><td>Stores an array of services defining access to the asset.</td></tr><tr><td><strong><code>credentials</code></strong></td><td><a href="#credentials">Credentials</a></td><td>Describes the credentials needed to access a dataset in addition to the <code>services</code> definition.</td></tr></tbody></table>
|
||||
<table><thead><tr><th width="203.33333333333331">Attribute</th><th width="226">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>@context</code></strong></td><td>Array of <code>string</code></td><td>Contexts used for validation.</td></tr><tr><td><strong><code>id</code></strong></td><td><code>string</code></td><td>Computed as <code>sha256(address of ERC721 contract + chainId)</code>.</td></tr><tr><td><strong><code>version</code></strong></td><td><code>string</code></td><td>Version information in <a href="https://semver.org">SemVer</a> notation referring to this DDO spec version, like <code>4.1.0</code>.</td></tr><tr><td><strong><code>chainId</code></strong></td><td><code>number</code></td><td>Stores chainId of the network the DDO was published to.</td></tr><tr><td><strong><code>nftAddress</code></strong></td><td><code>string</code></td><td>NFT contract linked to this asset</td></tr><tr><td><strong><code>metadata</code></strong></td><td><a href="ddo-specification.md#metadata">Metadata</a></td><td>Stores an object describing the asset.</td></tr><tr><td><strong><code>services</code></strong></td><td><a href="ddo-specification.md#services">Services</a></td><td>Stores an array of services defining access to the asset.</td></tr><tr><td><strong><code>credentials</code></strong></td><td><a href="ddo-specification.md#credentials">Credentials</a></td><td>Describes the credentials needed to access a dataset in addition to the <code>services</code> definition.</td></tr></tbody></table>
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Full Enhanced DDO Example</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"@context": ["https://w3id.org/did/v1"],
|
||||
@ -174,6 +171,7 @@ A DDO in Ocean has these required attributes:
|
||||
}
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
||||
@ -181,7 +179,7 @@ A DDO in Ocean has these required attributes:
|
||||
|
||||
This object holds information describing the actual asset.
|
||||
|
||||
<table><thead><tr><th width="208.33333333333331">Attribute</th><th width="252">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>created</code></strong></td><td><code>ISO date/time string</code></td><td>Contains the date of the creation of the dataset content in ISO 8601 format preferably with timezone designators, e.g. <code>2000-10-31T01:30:00Z</code>.</td></tr><tr><td><strong><code>updated</code></strong></td><td><code>ISO date/time string</code></td><td>Contains the date of last update of the dataset content in ISO 8601 format preferably with timezone designators, e.g. <code>2000-10-31T01:30:00Z</code>.</td></tr><tr><td><strong><code>description</code></strong>*</td><td><code>string</code></td><td>Details of what the resource is. For a dataset, this attribute explains what the data represents and what it can be used for.</td></tr><tr><td><strong><code>copyrightHolder</code></strong></td><td><code>string</code></td><td>The party holding the legal copyright. Empty by default.</td></tr><tr><td><strong><code>name</code></strong>*</td><td><code>string</code></td><td>Descriptive name or title of the asset.</td></tr><tr><td><strong><code>type</code></strong>*</td><td><code>string</code></td><td>Asset type. Includes <code>"dataset"</code> (e.g. csv file), <code>"algorithm"</code> (e.g. Python script). Each type needs a different subset of metadata attributes.</td></tr><tr><td><strong><code>author</code></strong>*</td><td><code>string</code></td><td>Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.).</td></tr><tr><td><strong><code>license</code></strong>*</td><td><code>string</code></td><td>Short name referencing the license of the asset (e.g. Public Domain, CC-0, CC-BY, No License Specified, etc. ). If it's not specified, the following value will be added: "No License Specified".</td></tr><tr><td><strong><code>links</code></strong></td><td>Array of <code>string</code></td><td>Mapping of URL strings for data samples, or links to find out more information. Links may be to either a URL or another asset.</td></tr><tr><td><strong><code>contentLanguage</code></strong></td><td><code>string</code></td><td>The language of the content. Use one of the language codes from the <a href="https://tools.ietf.org/html/bcp47">IETF BCP 47 standard</a></td></tr><tr><td><strong><code>tags</code></strong></td><td>Array of <code>string</code></td><td>Array of keywords or tags used to describe this content. Empty by default.</td></tr><tr><td><strong><code>categories</code></strong></td><td>Array of <code>string</code></td><td>Array of categories associated to the asset. Note: recommended to use <code>tags</code> instead of this.</td></tr><tr><td><strong><code>additionalInformation</code></strong></td><td>Object</td><td>Stores additional information, this is customizable by publisher</td></tr><tr><td><strong><code>algorithm</code></strong>**</td><td><a href="compute-to-data/compute-to-data-algorithms.md#algorithm-metadata">Algorithm Metadata</a></td><td>Information about asset of <code>type</code> <code>algorithm</code></td></tr></tbody></table>
|
||||
<table><thead><tr><th width="262.3333333333333">Attribute</th><th width="252">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>created</code></strong></td><td><code>ISO date/time string</code></td><td>Contains the date of the creation of the dataset content in ISO 8601 format preferably with timezone designators, e.g. <code>2000-10-31T01:30:00Z</code>.</td></tr><tr><td><strong><code>updated</code></strong></td><td><code>ISO date/time string</code></td><td>Contains the date of last update of the dataset content in ISO 8601 format preferably with timezone designators, e.g. <code>2000-10-31T01:30:00Z</code>.</td></tr><tr><td><strong><code>description</code></strong>*</td><td><code>string</code></td><td>Details of what the resource is. For a dataset, this attribute explains what the data represents and what it can be used for.</td></tr><tr><td><strong><code>copyrightHolder</code></strong></td><td><code>string</code></td><td>The party holding the legal copyright. Empty by default.</td></tr><tr><td><strong><code>name</code></strong>*</td><td><code>string</code></td><td>Descriptive name or title of the asset.</td></tr><tr><td><strong><code>type</code></strong>*</td><td><code>string</code></td><td>Asset type. Includes <code>"dataset"</code> (e.g. csv file), <code>"algorithm"</code> (e.g. Python script). Each type needs a different subset of metadata attributes.</td></tr><tr><td><strong><code>author</code></strong>*</td><td><code>string</code></td><td>Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.).</td></tr><tr><td><strong><code>license</code></strong>*</td><td><code>string</code></td><td>Short name referencing the license of the asset (e.g. Public Domain, CC-0, CC-BY, No License Specified, etc. ). If it's not specified, the following value will be added: "No License Specified".</td></tr><tr><td><strong><code>links</code></strong></td><td>Array of <code>string</code></td><td>Mapping of URL strings for data samples, or links to find out more information. Links may be to either a URL or another asset.</td></tr><tr><td><strong><code>contentLanguage</code></strong></td><td><code>string</code></td><td>The language of the content. Use one of the language codes from the <a href="https://tools.ietf.org/html/bcp47">IETF BCP 47 standard</a></td></tr><tr><td><strong><code>tags</code></strong></td><td>Array of <code>string</code></td><td>Array of keywords or tags used to describe this content. Empty by default.</td></tr><tr><td><strong><code>categories</code></strong></td><td>Array of <code>string</code></td><td>Array of categories associated to the asset. Note: recommended to use <code>tags</code> instead of this.</td></tr><tr><td><strong><code>additionalInformation</code></strong></td><td>Object</td><td>Stores additional information, this is customizable by publisher</td></tr><tr><td><strong><code>algorithm</code></strong>**</td><td><a href="did-ddo.md#algorithm-metadata">Algorithm Metadata</a></td><td>Information about asset of <code>type</code> <code>algorithm</code></td></tr></tbody></table>
|
||||
|
||||
\* Required
|
||||
|
||||
@ -213,7 +211,7 @@ Services define the access for an asset, and each service is represented by its
|
||||
|
||||
An asset should have at least one service to be actually accessible, and can have as many services which make sense for a specific use case.
|
||||
|
||||
<table><thead><tr><th width="229.33333333333331">Attribute</th><th width="211">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>id</code></strong>*</td><td><code>string</code></td><td>Unique ID</td></tr><tr><td><strong><code>type</code></strong>*</td><td><code>string</code></td><td>Type of service <code>access</code>, <code>compute</code>, <code>wss</code> etc.</td></tr><tr><td><strong><code>name</code></strong></td><td><code>string</code></td><td>Service friendly name</td></tr><tr><td><strong><code>description</code></strong></td><td><code>string</code></td><td>Service description</td></tr><tr><td><strong><code>datatokenAddress</code></strong>*</td><td><code>string</code></td><td>Datatoken</td></tr><tr><td><strong><code>serviceEndpoint</code></strong>*</td><td><code>string</code></td><td>Provider URL (schema + host)</td></tr><tr><td><strong><code>files</code></strong>*</td><td><a href="#files">Files</a></td><td>Encrypted file.</td></tr><tr><td><strong><code>timeout</code></strong>*</td><td><code>number</code></td><td>Describing how long the service can be used after consumption is initiated. A timeout of <code>0</code> represents no time limit. Expressed in seconds.</td></tr><tr><td><strong><code>compute</code></strong>**</td><td><a href="compute-to-data/compute-options.md">Compute</a></td><td>If service is of <code>type</code> <code>compute</code>, holds information about the compute-related privacy settings & resources.</td></tr><tr><td><strong><code>consumerParameters</code></strong></td><td><a href="compute-to-data/compute-options.md#consumer-parameters">Consumer Parameters</a></td><td>An object the defines required consumer input before consuming the asset</td></tr><tr><td><strong><code>additionalInformation</code></strong></td><td>Object</td><td>Stores additional information, this is customizable by publisher</td></tr></tbody></table>
|
||||
<table><thead><tr><th width="264.3333333333333">Attribute</th><th width="211">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>id</code></strong>*</td><td><code>string</code></td><td>Unique ID</td></tr><tr><td><strong><code>type</code></strong>*</td><td><code>string</code></td><td>Type of service <code>access</code>, <code>compute</code>, <code>wss</code> etc.</td></tr><tr><td><strong><code>name</code></strong></td><td><code>string</code></td><td>Service friendly name</td></tr><tr><td><strong><code>description</code></strong></td><td><code>string</code></td><td>Service description</td></tr><tr><td><strong><code>datatokenAddress</code></strong>*</td><td><code>string</code></td><td>Datatoken</td></tr><tr><td><strong><code>serviceEndpoint</code></strong>*</td><td><code>string</code></td><td>Provider URL (schema + host)</td></tr><tr><td><strong><code>files</code></strong>*</td><td><a href="did-ddo.md#files">Files</a></td><td>Encrypted file.</td></tr><tr><td><strong><code>timeout</code></strong>*</td><td><code>number</code></td><td>Describing how long the service can be used after consumption is initiated. A timeout of <code>0</code> represents no time limit. Expressed in seconds.</td></tr><tr><td><strong><code>compute</code></strong>**</td><td><a href="developers/compute-to-data/compute-options.md">Compute</a></td><td>If service is of <code>type</code> <code>compute</code>, holds information about the compute-related privacy settings & resources.</td></tr><tr><td><strong><code>consumerParameters</code></strong></td><td><a href="developers/compute-to-data/compute-options.md#consumer-parameters">Consumer Parameters</a></td><td>An object the defines required consumer input before consuming the asset</td></tr><tr><td><strong><code>additionalInformation</code></strong></td><td>Object</td><td>Stores additional information, this is customizable by publisher</td></tr></tbody></table>
|
||||
|
||||
\* Required
|
||||
|
||||
@ -227,11 +225,13 @@ The `files` field is returned as a `string` which holds the encrypted file URLs.
|
||||
|
||||
<summary>Files Example</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"files": "0x044736da6dae39889ff570c34540f24e5e084f4e5bd81eff3691b729c2dd1465ae8292fc721e9d4b1f10f56ce12036c9d149a4dab454b0795bd3ef8b7722c6001e0becdad5caeb2005859642284ef6a546c7ed76f8b350480691f0f6c6dfdda6c1e4d50ee90e83ce3cb3ca0a1a5a2544e10daa6637893f4276bb8d7301eb35306ece50f61ca34dcab550b48181ec81673953d4eaa4b5f19a45c0e9db4cd9729696f16dd05e0edb460623c843a263291ebe757c1eb3435bb529cc19023e0f49db66ef781ca692655992ea2ca7351ac2882bf340c9d9cb523b0cbcd483731dc03f6251597856afa9a68a1e0da698cfc8e81824a69d92b108023666ee35de4a229ad7e1cfa9be9946db2d909735"
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
||||
@ -326,13 +326,13 @@ Each asset has a state, which is held by the NFT contract. The possible states a
|
||||
|
||||
The following fields are added by _Aquarius_ in its DDO response for convenience reasons, where an asset returned by _Aquarius_ inherits the DDO fields stored on-chain.
|
||||
|
||||
These additional fields are never stored on-chain, and are never taken into consideration when [hashing the DDO](#ddo-checksum).
|
||||
These additional fields are never stored on-chain, and are never taken into consideration when [hashing the DDO](ddo-specification.md#ddo-checksum).
|
||||
|
||||
#### NFT
|
||||
|
||||
The `nft` object contains information about the ERC721 NFT contract which represents the intellectual property of the publisher.
|
||||
|
||||
<table><thead><tr><th width="168">Attribute</th><th width="174.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>address</code></strong></td><td><code>string</code></td><td>Contract address of the deployed ERC721 NFT contract.</td></tr><tr><td><strong><code>name</code></strong></td><td><code>string</code></td><td>Name of NFT set in contract.</td></tr><tr><td><strong><code>symbol</code></strong></td><td><code>string</code></td><td>Symbol of NFT set in contract.</td></tr><tr><td><strong><code>owner</code></strong></td><td><code>string</code></td><td>ETH account address of the NFT owner.</td></tr><tr><td><strong><code>state</code></strong></td><td><code>number</code></td><td>State of the asset reflecting the NFT contract value. See <a href="#state">State</a></td></tr><tr><td><strong><code>created</code></strong></td><td><code>ISO date/time string</code></td><td>Contains the date of NFT creation.</td></tr><tr><td><strong><code>tokenURI</code></strong></td><td><code>string</code></td><td>tokenURI</td></tr></tbody></table>
|
||||
<table><thead><tr><th width="168">Attribute</th><th width="174.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>address</code></strong></td><td><code>string</code></td><td>Contract address of the deployed ERC721 NFT contract.</td></tr><tr><td><strong><code>name</code></strong></td><td><code>string</code></td><td>Name of NFT set in contract.</td></tr><tr><td><strong><code>symbol</code></strong></td><td><code>string</code></td><td>Symbol of NFT set in contract.</td></tr><tr><td><strong><code>owner</code></strong></td><td><code>string</code></td><td>ETH account address of the NFT owner.</td></tr><tr><td><strong><code>state</code></strong></td><td><code>number</code></td><td>State of the asset reflecting the NFT contract value. See <a href="ddo-specification.md#state">State</a></td></tr><tr><td><strong><code>created</code></strong></td><td><code>ISO date/time string</code></td><td>Contains the date of NFT creation.</td></tr><tr><td><strong><code>tokenURI</code></strong></td><td><code>string</code></td><td>tokenURI</td></tr></tbody></table>
|
||||
|
||||
<details>
|
||||
|
||||
@ -355,7 +355,7 @@ The `nft` object contains information about the ERC721 NFT contract which repres
|
||||
|
||||
#### Datatokens
|
||||
|
||||
The `datatokens` array contains information about the ERC20 datatokens attached to [asset services](#services).
|
||||
The `datatokens` array contains information about the ERC20 datatokens attached to [asset services](ddo-specification.md#services).
|
||||
|
||||
<table><thead><tr><th width="170">Attribute</th><th width="169.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>address</code></strong></td><td><code>string</code></td><td>Contract address of the deployed ERC20 contract.</td></tr><tr><td><strong><code>name</code></strong></td><td><code>string</code></td><td>Name of NFT set in contract.</td></tr><tr><td><strong><code>symbol</code></strong></td><td><code>string</code></td><td>Symbol of NFT set in contract.</td></tr><tr><td><strong><code>serviceId</code></strong></td><td><code>string</code></td><td>ID of the service the datatoken is attached to.</td></tr></tbody></table>
|
||||
|
||||
@ -392,6 +392,7 @@ The `event` section contains information about the last transaction that created
|
||||
|
||||
<summary>Event Example</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"event": {
|
||||
@ -403,6 +404,7 @@ The `event` section contains information about the last transaction that created
|
||||
}
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
||||
@ -416,7 +418,15 @@ Contains information about an asset's purgatory status defined in [`list-purgato
|
||||
|
||||
<summary>Purgatory Example</summary>
|
||||
|
||||
\`\`\`json { "purgatory": { "state": true, "reason": "Copyright violation" } } \`\`\`
|
||||
```json
|
||||
{
|
||||
"purgatory": {
|
||||
"state": true,
|
||||
"reason": "Copyright violation"
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
@ -450,7 +460,7 @@ The `stats` section contains different statistics fields.
|
||||
|
||||
### Compute to data
|
||||
|
||||
For algorithms and datasets that are used for compute to data, there are additional fields and objects within the DDO structure that you need to consider. These include: 
|
||||
For algorithms and datasets that are used for compute to data, there are additional fields and objects within the DDO structure that you need to consider. These include:
|
||||
|
||||
* `compute` attributes.
|
||||
* `publisherTrustedAlgorithms`
|
||||
|
@ -96,26 +96,26 @@ You can start running the RBAC server by following these steps:
|
||||
|
||||
1. Clone this repository:
|
||||
|
||||
```Bash
|
||||
```bash
|
||||
git clone https://github.com/oceanprotocol/RBAC-Server.git
|
||||
cd RBAC-Server
|
||||
```
|
||||
|
||||
2. Install the dependencies:
|
||||
|
||||
```Bash
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
3. Build the service
|
||||
|
||||
```Bash
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
4. Start the server
|
||||
|
||||
```Bash
|
||||
```bash
|
||||
npm run start
|
||||
```
|
||||
|
||||
@ -126,13 +126,13 @@ When you are ready to deploy the RBAC server to
|
||||
1. Replace the KEYCLOAK\_URL in the Dockerfile with the correct URL for your hosting of [Keycloak](https://www.keycloak.org/).
|
||||
2. Run the following command to build the RBAC service in a Docker container:
|
||||
|
||||
```Bash
|
||||
```bash
|
||||
npm run build:docker
|
||||
```
|
||||
|
||||
3. Next, run the following command to start running the RBAC service in the Docker container:
|
||||
|
||||
```Bash
|
||||
```bash
|
||||
npm run start:docker
|
||||
```
|
||||
|
||||
|
@ -50,7 +50,7 @@ Here is the flow:
|
||||
|
||||
<figure><img src="../.gitbook/assets/architecture/publish_and_retrieve_ddos.png" alt=""><figcaption><p>DDO Flow</p></figcaption></figure>
|
||||
|
||||
To set up the metadata for an asset, you'll need to call the [**setMetaData**](https://github.com/oceanprotocol/contracts/blob/9e29194d910f28a4f0ef17ce6dc8a70741f63309/contracts/templates/ERC721Template.sol#L247) function at the contract level. 
|
||||
To set up the metadata for an asset, you'll need to call the [**setMetaData**](https://github.com/oceanprotocol/contracts/blob/9e29194d910f28a4f0ef17ce6dc8a70741f63309/contracts/templates/ERC721Template.sol#L247) function at the contract level.
|
||||
|
||||
* [**\_metaDataState**](ddo-specification.md#state) - Each asset has a state, which is held by the NFT contract. One of the following: active (0), end-of-life (1), deprecated (2), revoked (3), ordering temporarily disabled (4), and asset unlisted (5).
|
||||
* **\_metaDataDecryptorUrl** - You create the DDO and then the Provider encrypts it with its private key. Only that Provider can decrypt it.
|
||||
@ -60,6 +60,7 @@ To set up the metadata for an asset, you'll need to call the [**setMetaData**](h
|
||||
* **\_metaDataHash** - Hash of the clear data **generated before the encryption.** It is used by Provider to check the validity of the data after decryption.
|
||||
* **\_metadataProofs** - Array with signatures of entities who validated data (before the encryption). Pass an empty array if you don't have any.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```solidity
|
||||
function setMetadata(uint8 _metaDataState, string calldata _metaDataDecryptorUrl
|
||||
, string calldata _metaDataDecryptorAddress, bytes calldata flags,
|
||||
@ -72,6 +73,7 @@ function setMetadata(uint8 _metaDataState, string calldata _metaDataDecryptorUrl
|
||||
data,_metaDataHash, _metadataProofs);
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
{% hint style="info" %}
|
||||
While we utilize a specific DDO structure, you have the flexibility to customize it according to your unique requirements. However, to enable seamless processing, it is essential to have your own Aquarius instance that can handle your modified DDO.
|
||||
|
@ -33,7 +33,7 @@ The variable **AQUARIUS\_URL** and **PROVIDER\_URL** should be set correctly in
|
||||
|
||||
Create a new file in the same working directory where configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
|
||||
|
||||
<pre class="language-javascript"><code class="lang-javascript">// Note: Make sure .env file and config.js are created and setup correctly
|
||||
<pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">// Note: Make sure .env file and config.js are created and setup correctly
|
||||
const { oceanConfig } = require('./config.js');
|
||||
const { ZERO_ADDRESS, NftFactory, getHash, Nft } = require ('@oceanprotocol/lib');
|
||||
|
||||
|
@ -32,7 +32,7 @@ The below tabs show partially filled `.env` file content for some of the support
|
||||
{% tabs %}
|
||||
{% tab title="Mainnet" %}
|
||||
{% code title=".env" %}
|
||||
```
|
||||
```bash
|
||||
# Mandatory environment variables
|
||||
|
||||
OCEAN_NETWORK=mainnet
|
||||
@ -49,7 +49,7 @@ PROVIDER_URL=https://v4.provider.oceanprotocol.com
|
||||
|
||||
{% tab title="Polygon" %}
|
||||
{% code title=".env" %}
|
||||
```
|
||||
```bash
|
||||
# Mandatory environment variables
|
||||
|
||||
OCEAN_NETWORK=polygon
|
||||
@ -66,7 +66,7 @@ PROVIDER_URL=https://v4.provider.oceanprotocol.com
|
||||
|
||||
{% tab title="Local (using Barge)" %}
|
||||
{% code title=".env" %}
|
||||
```
|
||||
```bash
|
||||
# Mandatory environment variables
|
||||
OCEAN_NETWORK=development
|
||||
OCEAN_NETWORK_URL=http://172.15.0.3:8545/
|
||||
|
@ -31,7 +31,7 @@ The variable **AQUARIUS\_URL** and **PROVIDER\_URL** should be set correctly in
|
||||
|
||||
Create a new file in the same working directory where configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
|
||||
|
||||
<pre class="language-javascript"><code class="lang-javascript">// Note: Make sure .env file and config.js are created and setup correctly
|
||||
<pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">// Note: Make sure .env file and config.js are created and setup correctly
|
||||
const { oceanConfig } = require('./config.js');
|
||||
const { ZERO_ADDRESS, NftFactory, getHash, Nft } = require ('@oceanprotocol/lib');
|
||||
|
||||
|
@ -17,7 +17,7 @@ First, create a new file in the working directory, alongside the `config.js` and
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="create_dataNFT.js" %}
|
||||
{% code title="create_dataNFT.js" %}
|
||||
{% code title="create_dataNFT.js" overflow="wrap" %}
|
||||
```javascript
|
||||
// Note: Make sure .env file and config.js are created and setup correctly
|
||||
const { oceanConfig } = require('./config.js');
|
||||
|
@ -15,7 +15,7 @@ Create a new file in the same working directory where configuration file (`confi
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="mint_datatoken.js" %}
|
||||
{% code title="mint_datatoken.js" %}
|
||||
{% code title="mint_datatoken.js" overflow="wrap" %}
|
||||
```javascript
|
||||
// Note: Make sure .env file and config.js are created and setup correctly
|
||||
const { oceanConfig } = require('./config.js');
|
||||
@ -78,7 +78,7 @@ createMINT()
|
||||
|
||||
**Execute script**
|
||||
|
||||
```
|
||||
```bash
|
||||
node mint_datatoken.js
|
||||
```
|
||||
{% endtab %}
|
||||
|
@ -32,7 +32,7 @@ The `createFRE()` performs the following:
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="create_datatoken_with_fre.js" %}
|
||||
{% code title="create_datatoken_with_fre.js" %}
|
||||
{% code title="create_datatoken_with_fre.js" overflow="wrap" %}
|
||||
```javascript
|
||||
// Note: Make sure .env file and config.js are created and setup correctly
|
||||
const { oceanConfig } = require('./config.js');
|
||||
@ -109,13 +109,13 @@ createFRE()
|
||||
|
||||
Execute script
|
||||
|
||||
```
|
||||
```bash
|
||||
node create_datatoken_with_fre.js
|
||||
```
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="create_datatoken_with_free.js" %}
|
||||
{% code title="create_datatoken_with_free.js" %}
|
||||
{% code title="create_datatoken_with_free.js" overflow="wrap" %}
|
||||
```javascript
|
||||
// Note: Make sure .env file and config.js are created and setup correctly
|
||||
const { oceanConfig } = require('./config.js');
|
||||
|
@ -41,6 +41,7 @@ The variable **AQUARIUS\_URL** and **PROVIDER\_URL** should be set correctly in
|
||||
|
||||
Create a new file in the same working directory where configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```javascript
|
||||
// Note: Make sure .env file and config.js are created and setup correctly
|
||||
const { oceanConfig } = require('./config.js');
|
||||
@ -85,4 +86,5 @@ updateAssetState(did).then(() => {
|
||||
process.exit(1);
|
||||
});
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
|
@ -19,7 +19,7 @@ Create a new file in the same working directory where configuration file (`confi
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="ocean.js" %}
|
||||
{% code title="updateMetadata.js" %}
|
||||
{% code title="updateMetadata.js" overflow="wrap" %}
|
||||
```javascript
|
||||
// Note: Make sure .env file and config.js are created and setup correctly
|
||||
const { oceanConfig } = require('./config.js');
|
||||
|
@ -19,17 +19,21 @@ Please note that if a signature parameter exists, it will take precedence over t
|
||||
|
||||
**Curl Example:**
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```
|
||||
GET /api/services/createAuthToken?address=<your_address>&&nonce=<your_nonce>&&expiration=<expiration>&signature=<your_signature>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Inside the angular brackets, the user should provide the valid values for the request.
|
||||
|
||||
Response:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```
|
||||
{"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NjAwNTMxMjksImFkZHJlc3MiOiIweEE3OGRlYjJGYTc5NDYzOTQ1QzI0Nzk5MTA3NUUyYTBlOThCYTdBMDkifQ.QaRqYeSYxZpnFayzPmUkj8TORHHJ_vRY-GL88ZBFM0o"}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Javascript Example:
|
||||
|
||||
@ -68,7 +72,8 @@ Returns: Success message if token is successfully deleted. If the token is not f
|
||||
|
||||
#### Javascript Example:
|
||||
|
||||
```
|
||||
{% code overflow="wrap" %}
|
||||
```javascript
|
||||
const axios = require('axios');
|
||||
|
||||
// Define the address, token, and signature
|
||||
@ -98,6 +103,7 @@ axios.delete(deleteAuthTokenURL, {
|
||||
});
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Replace `<provider_url>`, `<your_address>`, `<your_token>`, and `<your_signature>` with actual values. This script sends a DELETE request to the `deleteAuthToken` endpoint and logs the response. Please ensure that `axios` is installed in your environment (`npm install axios`).
|
||||
|
||||
|
@ -40,6 +40,7 @@ Start a new job
|
||||
|
||||
Parameters
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```
|
||||
signature: String object containg user signature (signed message) (required)
|
||||
consumerAddress: String object containing consumer's ethereum address (required)
|
||||
@ -62,12 +63,13 @@ Parameters
|
||||
|
||||
One of `algorithm.documentId` or `algorithm.meta` is required, `algorithm.meta` takes precedence
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Returns: Array of `status` objects as described above, in this case the array will have only one object
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
```json
|
||||
POST /api/compute
|
||||
payload:
|
||||
{
|
||||
@ -104,6 +106,7 @@ Get all jobs and corresponding stats
|
||||
|
||||
Parameters
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```
|
||||
signature: String object containg user signature (signed message)
|
||||
documentId: String object containing document did (optional)
|
||||
@ -112,6 +115,7 @@ Parameters
|
||||
|
||||
At least one parameter from documentId, jobId and owner is required (can be any of them)
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Returns
|
||||
|
||||
@ -178,9 +182,11 @@ Returns: Bytes string containing the compute result.
|
||||
|
||||
Example:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```
|
||||
GET /api/services/computeResult?index=0&consumerAddress=0xA78deb2Fa79463945C247991075E2a0e98Ba7A09&jobId=4d32947065bb46c8b87c1f7adfb7ed8b&nonce=1644317370
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Response:
|
||||
|
||||
@ -196,6 +202,7 @@ Stop a running compute job.
|
||||
|
||||
Parameters
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```
|
||||
signature: String object containg user signature (signed message)
|
||||
documentId: String object containing document did (optional)
|
||||
@ -204,6 +211,7 @@ Parameters
|
||||
|
||||
At least one parameter from documentId,jobId and owner is required (can be any of them)
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Returns
|
||||
|
||||
@ -275,15 +283,18 @@ Allows download of asset data file.
|
||||
|
||||
Parameters
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```
|
||||
chainID: Int object representing the chain ID that the Provider is connected to (mandatory)
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Returns: List of compute environments.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
GET /api/services/computeEnvironments
|
||||
GET /api/services/computeEnvironments?chainId=8996
|
||||
```
|
||||
|
||||
Response:
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
Example response:
|
||||
|
||||
```
|
||||
```python
|
||||
b'0x04b2bfab1f4e...7ed0573'
|
||||
```
|
||||
|
||||
@ -48,7 +48,8 @@ console.log(response)
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
```
|
||||
{% code overflow="wrap" %}
|
||||
```javascript
|
||||
const axios = require('axios');
|
||||
|
||||
async function decryptAsset(payload) {
|
||||
@ -87,11 +88,14 @@ let payload = {
|
||||
decryptAsset(payload);
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
|
||||
|
||||
Example response:
|
||||
|
||||
```
|
||||
{% code overflow="wrap" %}
|
||||
```python
|
||||
b'{"@context": ["https://w3id.org/did/v1"], "id": "did:op:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c ...'
|
||||
```
|
||||
{% endcode %}
|
||||
|
@ -14,7 +14,7 @@ Here are some typical responses you might receive from the API:
|
||||
|
||||
Example response:
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
"nonce": 23
|
||||
}
|
||||
@ -96,7 +96,7 @@ Before calling the `/download` endpoint, you need to follow these steps: 
|
||||
3. Sign a message from the account that has purchased the datatoken. 
|
||||
4. Add the nonce and signature to the payload.
|
||||
|
||||
```
|
||||
```javascript
|
||||
const axios = require('axios');
|
||||
|
||||
async function downloadAsset(payload) {
|
||||
@ -157,7 +157,7 @@ The datatoken is transferred on the blockchain by requesting the user to sign an
|
||||
|
||||
#### Javascript Example
|
||||
|
||||
```
|
||||
```javascript
|
||||
const axios = require('axios');
|
||||
|
||||
async function initializeServiceAccess(payload) {
|
||||
|
@ -29,7 +29,7 @@ Parameters:
|
||||
* `method` - The HTTP method, required
|
||||
* `headers` - Additional HTTP headers, optional
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
"type": "url",
|
||||
"url": "https://url.com/file1.csv",
|
||||
@ -52,7 +52,7 @@ Parameters:
|
||||
|
||||
* `hash` - The file hash
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
"type": "ipfs",
|
||||
"hash": "XXX"
|
||||
@ -71,7 +71,7 @@ Parameters:
|
||||
* `query` - The query to be executed, required
|
||||
* `headers` - Additional HTTP headers, optional
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
"type": "graphql",
|
||||
"url": "http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph",
|
||||
@ -99,7 +99,8 @@ Parameters:
|
||||
* `address` - The smartcontract address, required
|
||||
* `abi` - The function abi (NOT the entire contract abi), required
|
||||
|
||||
```
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"type": "smartcontract",
|
||||
"chainId": 1,
|
||||
@ -113,6 +114,7 @@ Parameters:
|
||||
}
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
## Arweave
|
||||
|
||||
@ -122,7 +124,7 @@ Parameters:
|
||||
|
||||
* `transactionId` - The transaction identifier
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
{
|
||||
"type": "arweave",
|
||||
|
@ -71,41 +71,41 @@ The Python script below can be used to run the query and fetch the list of buyer
|
||||
|
||||
**Create Script**
|
||||
|
||||
{% code title="datatoken_buyers.py" %}
|
||||
```python
|
||||
datatoken_information.py
|
||||
import requests
|
||||
import json
|
||||
|
||||
datatoken_address = "0xc22bfd40f81c4a28c809f80d05070b95a11829d9"
|
||||
query = """
|
||||
{{
|
||||
token(id : "${datatoken_address}") {
|
||||
id,
|
||||
orders(
|
||||
orderBy: createdTimestamp
|
||||
orderDirection: desc
|
||||
first: 1000
|
||||
) {
|
||||
id
|
||||
consumer {
|
||||
id
|
||||
}
|
||||
payer {
|
||||
id
|
||||
}
|
||||
reuses {
|
||||
id
|
||||
}
|
||||
block
|
||||
createdTimestamp
|
||||
amount
|
||||
}
|
||||
}
|
||||
token(id:"{0}"){{
|
||||
id,
|
||||
orders(
|
||||
orderBy: createdTimestamp
|
||||
orderDirection: desc
|
||||
first: 1000
|
||||
){{
|
||||
id
|
||||
consumer{{
|
||||
id
|
||||
}}
|
||||
payer{{
|
||||
id
|
||||
}}
|
||||
reuses{{
|
||||
id
|
||||
}}
|
||||
block
|
||||
createdTimestamp
|
||||
amount
|
||||
}}
|
||||
}}
|
||||
}}""".format(
|
||||
datatoken_address
|
||||
)
|
||||
|
||||
base_url = "https://v4.subgraph.mumbai.oceanprotocol.com/"
|
||||
base_url = "https://v4.subgraph.mumbai.oceanprotocol.com"
|
||||
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
|
||||
url = base_url + route
|
||||
@ -117,6 +117,7 @@ result = json.loads(response.text)
|
||||
|
||||
print(json.dumps(result, indent=4, sort_keys=True))
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
**Execute Script**
|
||||
|
||||
@ -160,211 +161,213 @@ Copy the query to fetch the list of buyers for a datatoken in the Ocean Subgraph
|
||||
|
||||
<summary>Sample response</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"token": {
|
||||
"id": "0xc22bfd40f81c4a28c809f80d05070b95a11829d9",
|
||||
"orders": [
|
||||
{
|
||||
"id": "0xd65c927af039bed60be4bfcb00a75eebe7db695598350ba9bc6cb5d6a6180062-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x0b58857708a6f84e7ee04beaef069a7e6d1d4a0b-38.0",
|
||||
"consumer": {
|
||||
"id": "0x0b58857708a6f84e7ee04beaef069a7e6d1d4a0b"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x0b58857708a6f84e7ee04beaef069a7e6d1d4a0b"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 36669814,
|
||||
"createdTimestamp": 1686386048,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x118317568256f457a6ac29ba03875ad83815d5d8ec834c721ea20d80643d8629-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x027bfbe29df80bde49845b6fecf5e4ed14518f1f-0.0",
|
||||
"consumer": {
|
||||
"id": "0x027bfbe29df80bde49845b6fecf5e4ed14518f1f"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x027bfbe29df80bde49845b6fecf5e4ed14518f1f"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 35582325,
|
||||
"createdTimestamp": 1684067341,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0xe9668b60b5fe7cbfacf0311ae4dc93c50c43484c0a8cf94db783ffbee1be7cd5-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x86874bf84f0d27dcfc6c4c34ab99aad8ced8d892-1.0",
|
||||
"consumer": {
|
||||
"id": "0x86874bf84f0d27dcfc6c4c34ab99aad8ced8d892"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x86874bf84f0d27dcfc6c4c34ab99aad8ced8d892"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 35578590,
|
||||
"createdTimestamp": 1684059403,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x047a7ce1b3c69a5fc4c2c8078a2cc356164519077ef095265e4bcba1e0baf6c9-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0xb62e762af637b49eb4870bce8fe21bfff189e495-0.0",
|
||||
"consumer": {
|
||||
"id": "0xb62e762af637b49eb4870bce8fe21bfff189e495"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0xb62e762af637b49eb4870bce8fe21bfff189e495"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 35511102,
|
||||
"createdTimestamp": 1683915991,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x8cbfb5a85d43f5a5b4aff4a2d657fe7dac4528a86cc78f21897fdd0169d3b3c3-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x85c1bbdc1b6a199e0964cb849deb59aef3045edd-0.0",
|
||||
"consumer": {
|
||||
"id": "0x85c1bbdc1b6a199e0964cb849deb59aef3045edd"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x85c1bbdc1b6a199e0964cb849deb59aef3045edd"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 35331127,
|
||||
"createdTimestamp": 1683533500,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x246637f9a410664c6880e7768880696763e7fd66aa7cc286fdc62d5d8589481c-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0xf9df381272afc2d1bd8fbbc0061cdb1d387c2032-3.0",
|
||||
"consumer": {
|
||||
"id": "0xf9df381272afc2d1bd8fbbc0061cdb1d387c2032"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0xf9df381272afc2d1bd8fbbc0061cdb1d387c2032"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 35254580,
|
||||
"createdTimestamp": 1683370838,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0xed9bcc6149cab8ee67a38d6b423a05ca328533d43ff83aff140fe9c424e449ee-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede-9.0",
|
||||
"consumer": {
|
||||
"id": "0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 35110175,
|
||||
"createdTimestamp": 1683063962,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0xa97fa2c99f8e5f16ba7245989830c552bace1f72476f5dee4da01c0d56ada7be-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd-12.0",
|
||||
"consumer": {
|
||||
"id": "0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 35053093,
|
||||
"createdTimestamp": 1682942664,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0xb9b72efad41ded4fcb7e23f14a7caa3ebc4fdfbb710318cbf25d92068c8a650d-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd-0.0",
|
||||
"consumer": {
|
||||
"id": "0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 34985052,
|
||||
"createdTimestamp": 1682798076,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x9d616c85fdfe8655640bf77ecea0e42a7a9d331c5f51975f2a56b4f5ac8ec955-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff-0.0",
|
||||
"consumer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 34984847,
|
||||
"createdTimestamp": 1682797640,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x16eee832f9e85ca8ac8f82aecb8861e5bb5378c2771bf9abd3930b9438dbbc01-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff-9.0",
|
||||
"consumer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 34982389,
|
||||
"createdTimestamp": 1682792418,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x5264d4694fc78d9211a658363d98571f8d455dfcf89f3450520909416a103c2c-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff-0.0",
|
||||
"consumer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 34980112,
|
||||
"createdTimestamp": 1682787580,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x7222faab923d80218b242aec2670c1a775c77a254a28782e04aed5cb36c395d3-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x616b5249aaf1c924339f8b8e94474e64ceb22af3-18.0",
|
||||
"consumer": {
|
||||
"id": "0x616b5249aaf1c924339f8b8e94474e64ceb22af3"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x616b5249aaf1c924339f8b8e94474e64ceb22af3"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 34969169,
|
||||
"createdTimestamp": 1682764326,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x3eae9d33fe3223e25ca058955744c98ba8aa211b1e3e1bf62eb653c0d0441b79-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x71eb23e03d3005803db491639a7ebb717810bd04-0.0",
|
||||
"consumer": {
|
||||
"id": "0x71eb23e03d3005803db491639a7ebb717810bd04"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x71eb23e03d3005803db491639a7ebb717810bd04"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 34938635,
|
||||
"createdTimestamp": 1682699439,
|
||||
"amount": "1"
|
||||
},
|
||||
{
|
||||
"id": "0x8dfe458aa689a29ceea3208f55856420dbfd80ed777fd01103581cff9d7d76b7-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede-0.0",
|
||||
"consumer": {
|
||||
"id": "0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede"
|
||||
},
|
||||
"payer": {
|
||||
"id": "0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede"
|
||||
},
|
||||
"reuses": [],
|
||||
"block": 34938633,
|
||||
"createdTimestamp": 1682699435,
|
||||
"amount": "1"
|
||||
"data": {
|
||||
"token": {
|
||||
"id": "0xc22bfd40f81c4a28c809f80d05070b95a11829d9",
|
||||
"orders": [
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 36669814,
|
||||
"consumer": {
|
||||
"id": "0x0b58857708a6f84e7ee04beaef069a7e6d1d4a0b"
|
||||
},
|
||||
"createdTimestamp": 1686386048,
|
||||
"id": "0xd65c927af039bed60be4bfcb00a75eebe7db695598350ba9bc6cb5d6a6180062-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x0b58857708a6f84e7ee04beaef069a7e6d1d4a0b-38.0",
|
||||
"payer": {
|
||||
"id": "0x0b58857708a6f84e7ee04beaef069a7e6d1d4a0b"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 35582325,
|
||||
"consumer": {
|
||||
"id": "0x027bfbe29df80bde49845b6fecf5e4ed14518f1f"
|
||||
},
|
||||
"createdTimestamp": 1684067341,
|
||||
"id": "0x118317568256f457a6ac29ba03875ad83815d5d8ec834c721ea20d80643d8629-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x027bfbe29df80bde49845b6fecf5e4ed14518f1f-0.0",
|
||||
"payer": {
|
||||
"id": "0x027bfbe29df80bde49845b6fecf5e4ed14518f1f"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 35578590,
|
||||
"consumer": {
|
||||
"id": "0x86874bf84f0d27dcfc6c4c34ab99aad8ced8d892"
|
||||
},
|
||||
"createdTimestamp": 1684059403,
|
||||
"id": "0xe9668b60b5fe7cbfacf0311ae4dc93c50c43484c0a8cf94db783ffbee1be7cd5-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x86874bf84f0d27dcfc6c4c34ab99aad8ced8d892-1.0",
|
||||
"payer": {
|
||||
"id": "0x86874bf84f0d27dcfc6c4c34ab99aad8ced8d892"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 35511102,
|
||||
"consumer": {
|
||||
"id": "0xb62e762af637b49eb4870bce8fe21bfff189e495"
|
||||
},
|
||||
"createdTimestamp": 1683915991,
|
||||
"id": "0x047a7ce1b3c69a5fc4c2c8078a2cc356164519077ef095265e4bcba1e0baf6c9-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0xb62e762af637b49eb4870bce8fe21bfff189e495-0.0",
|
||||
"payer": {
|
||||
"id": "0xb62e762af637b49eb4870bce8fe21bfff189e495"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 35331127,
|
||||
"consumer": {
|
||||
"id": "0x85c1bbdc1b6a199e0964cb849deb59aef3045edd"
|
||||
},
|
||||
"createdTimestamp": 1683533500,
|
||||
"id": "0x8cbfb5a85d43f5a5b4aff4a2d657fe7dac4528a86cc78f21897fdd0169d3b3c3-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x85c1bbdc1b6a199e0964cb849deb59aef3045edd-0.0",
|
||||
"payer": {
|
||||
"id": "0x85c1bbdc1b6a199e0964cb849deb59aef3045edd"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 35254580,
|
||||
"consumer": {
|
||||
"id": "0xf9df381272afc2d1bd8fbbc0061cdb1d387c2032"
|
||||
},
|
||||
"createdTimestamp": 1683370838,
|
||||
"id": "0x246637f9a410664c6880e7768880696763e7fd66aa7cc286fdc62d5d8589481c-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0xf9df381272afc2d1bd8fbbc0061cdb1d387c2032-3.0",
|
||||
"payer": {
|
||||
"id": "0xf9df381272afc2d1bd8fbbc0061cdb1d387c2032"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 35110175,
|
||||
"consumer": {
|
||||
"id": "0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede"
|
||||
},
|
||||
"createdTimestamp": 1683063962,
|
||||
"id": "0xed9bcc6149cab8ee67a38d6b423a05ca328533d43ff83aff140fe9c424e449ee-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede-9.0",
|
||||
"payer": {
|
||||
"id": "0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 35053093,
|
||||
"consumer": {
|
||||
"id": "0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd"
|
||||
},
|
||||
"createdTimestamp": 1682942664,
|
||||
"id": "0xa97fa2c99f8e5f16ba7245989830c552bace1f72476f5dee4da01c0d56ada7be-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd-12.0",
|
||||
"payer": {
|
||||
"id": "0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 34985052,
|
||||
"consumer": {
|
||||
"id": "0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd"
|
||||
},
|
||||
"createdTimestamp": 1682798076,
|
||||
"id": "0xb9b72efad41ded4fcb7e23f14a7caa3ebc4fdfbb710318cbf25d92068c8a650d-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd-0.0",
|
||||
"payer": {
|
||||
"id": "0x56e08babb8bf928bd8571d2a2a78235ae57ae5bd"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 34984847,
|
||||
"consumer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"createdTimestamp": 1682797640,
|
||||
"id": "0x9d616c85fdfe8655640bf77ecea0e42a7a9d331c5f51975f2a56b4f5ac8ec955-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff-0.0",
|
||||
"payer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 34982389,
|
||||
"consumer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"createdTimestamp": 1682792418,
|
||||
"id": "0x16eee832f9e85ca8ac8f82aecb8861e5bb5378c2771bf9abd3930b9438dbbc01-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff-9.0",
|
||||
"payer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 34980112,
|
||||
"consumer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"createdTimestamp": 1682787580,
|
||||
"id": "0x5264d4694fc78d9211a658363d98571f8d455dfcf89f3450520909416a103c2c-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff-0.0",
|
||||
"payer": {
|
||||
"id": "0x3f0cc2ad70839e2b684f173389f7dd71fe5186ff"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 34969169,
|
||||
"consumer": {
|
||||
"id": "0x616b5249aaf1c924339f8b8e94474e64ceb22af3"
|
||||
},
|
||||
"createdTimestamp": 1682764326,
|
||||
"id": "0x7222faab923d80218b242aec2670c1a775c77a254a28782e04aed5cb36c395d3-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x616b5249aaf1c924339f8b8e94474e64ceb22af3-18.0",
|
||||
"payer": {
|
||||
"id": "0x616b5249aaf1c924339f8b8e94474e64ceb22af3"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 34938635,
|
||||
"consumer": {
|
||||
"id": "0x71eb23e03d3005803db491639a7ebb717810bd04"
|
||||
},
|
||||
"createdTimestamp": 1682699439,
|
||||
"id": "0x3eae9d33fe3223e25ca058955744c98ba8aa211b1e3e1bf62eb653c0d0441b79-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x71eb23e03d3005803db491639a7ebb717810bd04-0.0",
|
||||
"payer": {
|
||||
"id": "0x71eb23e03d3005803db491639a7ebb717810bd04"
|
||||
},
|
||||
"reuses": []
|
||||
},
|
||||
{
|
||||
"amount": "1",
|
||||
"block": 34938633,
|
||||
"consumer": {
|
||||
"id": "0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede"
|
||||
},
|
||||
"createdTimestamp": 1682699435,
|
||||
"id": "0x8dfe458aa689a29ceea3208f55856420dbfd80ed777fd01103581cff9d7d76b7-0xc22bfd40f81c4a28c809f80d05070b95a11829d9-0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede-0.0",
|
||||
"payer": {
|
||||
"id": "0x726ab53c8da3efed40a32fe6ab5daa65b9da7ede"
|
||||
},
|
||||
"reuses": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
@ -160,36 +160,37 @@ Copy the query to fetch the information about a data NFT in the Ocean Subgraph [
|
||||
|
||||
<summary>Sample response</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"nft": {
|
||||
"address": "0x1c161d721e6d99f58d47f709cdc77025056c544c",
|
||||
"assetState": 0,
|
||||
"block": 15185270,
|
||||
"createdTimestamp": 1658397870,
|
||||
"creator": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"erc20DeployerRole": [
|
||||
"0x1706df1f2d93558d1d77bed49ccdb8b88fafc306"
|
||||
],
|
||||
"id": "0x1c161d721e6d99f58d47f709cdc77025056c544c",
|
||||
"managerRole": [
|
||||
"0xd30dd83132f2227f114db8b90f565bca2832afbd"
|
||||
],
|
||||
"metadataRole": null,
|
||||
"name": "Ocean Data NFT",
|
||||
"orderCount": "1",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"providerUrl": "https://v4.provider.mainnet.oceanprotocol.com",
|
||||
"storeUpdateRole": null,
|
||||
"symbol": "OCEAN-NFT",
|
||||
"template": "",
|
||||
"tokenUri": "<removed>",
|
||||
"transferable": true,
|
||||
"tx": "0x327a9da0d2e9df945fd2f8e10b1caa77acf98e803c5a2f588597172a0bcbb93a"
|
||||
"data": {
|
||||
"nft": {
|
||||
"address": "0x1c161d721e6d99f58d47f709cdc77025056c544c",
|
||||
"assetState": 0,
|
||||
"block": 15185270,
|
||||
"createdTimestamp": 1658397870,
|
||||
"erc20DeployerRole": [
|
||||
"0x1706df1f2d93558d1d77bed49ccdb8b88fafc306"
|
||||
],
|
||||
"id": "0x1c161d721e6d99f58d47f709cdc77025056c544c",
|
||||
"managerRole": [
|
||||
"0xd30dd83132f2227f114db8b90f565bca2832afbd"
|
||||
],
|
||||
"metadataRole": null,
|
||||
"name": "Ocean Data NFT",
|
||||
"orderCount": "1",
|
||||
"providerUrl": "https://v4.provider.mainnet.oceanprotocol.com",
|
||||
"storeUpdateRole": null,
|
||||
"symbol": "OCEAN-NFT",
|
||||
"template": "",
|
||||
"tokenUri": "data:application/json;base64,eyJuYW1lIjoiT2NlYW4gRGF0YSBORlQiLCJzeW1ib2wiOiJPQ0VBTi1ORlQiLCJkZXNjcmlwdGlvbiI6IlRoaXMgTkZUIHJlcHJlc2VudHMgYW4gYXNzZXQgaW4gdGhlIE9jZWFuIFByb3RvY29sIHY0IGVjb3N5c3RlbS5cblxuVmlldyBvbiBPY2VhbiBNYXJrZXQ6IGh0dHBzOi8vbWFya2V0Lm9jZWFucHJvdG9jb2wuY29tL2Fzc2V0L2RpZDpvcDo1YzdjNThjYWNhNDAzMmU2NzNhNDE2NWM3N2YxOGQ0MDVmYmVlODc3YzA3OGFhMjU3ZjY1ODdhZjM5NzhkYTVmIiwiZXh0ZXJuYWxfdXJsIjoiaHR0cHM6Ly9tYXJrZXQub2NlYW5wcm90b2NvbC5jb20vYXNzZXQvZGlkOm9wOjVjN2M1OGNhY2E0MDMyZTY3M2E0MTY1Yzc3ZjE4ZDQwNWZiZWU4NzdjMDc4YWEyNTdmNjU4N2FmMzk3OGRhNWYiLCJiYWNrZ3JvdW5kX2NvbG9yIjoiMTQxNDE0IiwiaW1hZ2VfZGF0YSI6ImRhdGE6aW1hZ2Uvc3ZnK3htbCwlM0Nzdmcgdmlld0JveD0nMCAwIDk5IDk5JyBmaWxsPSd1bmRlZmluZWQnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyclM0UlM0NwYXRoIGZpbGw9JyUyM2ZmNDA5Mjc3JyBkPSdNMCw5OUwwLDI3QzgsMjkgMTcsMzEgMjUsMzBDMzIsMjggMzgsMjQgNDYsMjVDNTMsMjUgNjIsMjkgNzIsMzFDODEsMzIgOTAsMzEgOTksMzBMOTksOTlaJy8lM0UlM0NwYXRoIGZpbGw9JyUyM2ZmNDA5MmJiJyBkPSdNMCw5OUwwLDU0QzgsNTIgMTcsNTAgMjYsNTFDMzQsNTEgNDIsNTUgNTEsNTVDNTksNTQgNjcsNDkgNzYsNDlDODQsNDggOTEsNTIgOTksNTZMOTksOTlaJyUzRSUzQy9wYXRoJTNFJTNDcGF0aCBmaWxsPSclMjNmZjQwOTJmZicgZD0nTTAsOTlMMCw4MEM4LDc4IDE3LDc3IDI3LDc3QzM2LDc2IDQ1LDc3IDUyLDc3QzU4LDc2IDYzLDc0IDcxLDczQzc4LDcxIDg4LDcxIDk5LDcxTDk5LDk5WiclM0UlM0MvcGF0aCUzRSUzQy9zdmclM0UifQ==",
|
||||
"transferable": true,
|
||||
"tx": "0x327a9da0d2e9df945fd2f8e10b1caa77acf98e803c5a2f588597172a0bcbb93a"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
@ -89,6 +89,10 @@ The Python script below can be used to run the query and fetch the datatoken inf
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
import requests
|
||||
import json
|
||||
|
||||
datatoken_address = "0x122d10d543bc600967b4db0f45f80cb1ddee43eb"
|
||||
query = """
|
||||
{{
|
||||
@ -130,14 +134,14 @@ query = """
|
||||
)
|
||||
|
||||
base_url = "https://v4.subgraph.mainnet.oceanprotocol.com/"
|
||||
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
route = "subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
|
||||
url = base_url + route
|
||||
|
||||
headers = {"Content-Type": "application/json"}
|
||||
payload = json.dumps({"query": query})
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
result = json.loads(response.text)
|
||||
result = response.json()
|
||||
|
||||
print(json.dumps(result, indent=4, sort_keys=True))
|
||||
```
|
||||
@ -196,43 +200,121 @@ Copy the query to fetch the information of a datatoken in the Ocean Subgraph [Gr
|
||||
|
||||
<summary>Sample response</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"fixedRateExchanges": [
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x06284c39b48afe5f01a04d56f1aae45dbb29793b190ee11e93a4a77215383d44",
|
||||
"price": "33"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x2719862ebc4ed253f09088c878e00ef8ee2a792e1c5c765fac35dc18d7ef4deb",
|
||||
"price": "35"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x2dccaa373e4b65d5ec153c150270e989d1bda1efd3794c851e45314c40809f9c",
|
||||
"price": "33"
|
||||
}
|
||||
],
|
||||
"token": {
|
||||
"cap": "115792089237316195423570985008687900000000000000000000000000",
|
||||
"holderCount": "0",
|
||||
"id": "0x122d10d543bc600967b4db0f45f80cb1ddee43eb",
|
||||
"isDatatoken": true,
|
||||
"name": "Brave Lobster Token",
|
||||
"nft": {
|
||||
"address": "0xea615374949a2405c3ee555053eca4d74ec4c2f0",
|
||||
"name": "Ocean Data NFT",
|
||||
"symbol": "OCEAN-NFT"
|
||||
},
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": "BRALOB-11"
|
||||
"data": {
|
||||
"fixedRateExchanges": [
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x06284c39b48afe5f01a04d56f1aae45dbb29793b190ee11e93a4a77215383d44",
|
||||
"price": "600"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x103714d9d215b971253ef72b4f5de6b0cb0df1ad9a3763cec698262c64cbecfe",
|
||||
"price": "1000"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x2719862ebc4ed253f09088c878e00ef8ee2a792e1c5c765fac35dc18d7ef4deb",
|
||||
"price": "35"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x2dccaa373e4b65d5ec153c150270e989d1bda1efd3794c851e45314c40809f9c",
|
||||
"price": "33"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x43b8de24276d304c2dead8560db460aab3f81f173b4f3710f7d9bda4ae3cef22",
|
||||
"price": "600"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x4d81e7e5944b819df7e978147fd2a94b09705938861bbbb496077913f80d824c",
|
||||
"price": "5"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x6e4d73b0f346d03c82ebe7d41501d06d3c38f15ca19ee973029bc0a8d2da95fc",
|
||||
"price": "50"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x82a659688a4df76226768ec49d9e994a83fb87410d00d88958eb603da0462341",
|
||||
"price": "5"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x86162b68bcfcc3d8efb726e0c3ff85809e8e45568f3fd986eafe89eb8fa96b3f",
|
||||
"price": "1"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x8d7ccaa8354664556735c75807f75a00ad3e8fa9e7b72d9ca5dc22eb852c5088",
|
||||
"price": "5"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0xb02d83434f392b295def216c5763e277265d3c0a414e73192961495408817d40",
|
||||
"price": "1"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0xb32cd1971f1a3e69b823a5b27caea8232fdcca9546e72cc34b569ce13aa78530",
|
||||
"price": "250"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0xb3fcb7ab8c771ddbf56bc3b6cd9f68dd8a5193dfcec68c17306f8c464eac6314",
|
||||
"price": "6000"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0xbceef39ad618897160748717cefe79fd49b9e9be37ae5021998cf82b3a345a78",
|
||||
"price": "1000000"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0xce52c09d65a8988096f274601247ebc63fed02fd3bfd56e991637f5ac4e44b2c",
|
||||
"price": "40000"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0xe3ac2efddaa5446436fb25560756d82ebcb865d4605a41997c4d4a6ca32e7273",
|
||||
"price": "5800"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0xf96208141ec3f5bc80cc05d265a5e13a71b1be7e66415ec241ebd100107d6a6d",
|
||||
"price": "10"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0xfcf20144a14c7b2f51319d938436e34041acbd65e1e29319549ed7923b9fd86e",
|
||||
"price": "1000000"
|
||||
}
|
||||
],
|
||||
"token": {
|
||||
"cap": "115792089237316195423570985008687900000000000000000000000000",
|
||||
"holderCount": "0",
|
||||
"id": "0x122d10d543bc600967b4db0f45f80cb1ddee43eb",
|
||||
"isDatatoken": true,
|
||||
"name": "Brave Lobster Token",
|
||||
"nft": {
|
||||
"address": "0xea615374949a2405c3ee555053eca4d74ec4c2f0",
|
||||
"name": "Ocean Data NFT",
|
||||
"symbol": "OCEAN-NFT"
|
||||
},
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": "BRALOB-11"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
@ -98,7 +98,7 @@ print(json.dumps(result, indent=4, sort_keys=True))
|
||||
|
||||
**Execute script**
|
||||
|
||||
```
|
||||
```bash
|
||||
python list_dataNFTs.py
|
||||
```
|
||||
{% endtab %}
|
||||
@ -128,6 +128,7 @@ Copy the query to fetch a list of data NFTs in the Ocean Subgraph [GraphiQL inte
|
||||
|
||||
<summary>Sample response</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
@ -246,5 +247,6 @@ Copy the query to fetch a list of data NFTs in the Ocean Subgraph [GraphiQL inte
|
||||
}
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|
@ -79,38 +79,36 @@ import requests
|
||||
import json
|
||||
|
||||
query = """
|
||||
{{
|
||||
tokens(skip:0, first: 2, subgraphError: deny){{
|
||||
{
|
||||
tokens(skip:0, first:2, subgraphError:deny) {
|
||||
id
|
||||
symbol
|
||||
nft {{
|
||||
nft {
|
||||
name
|
||||
symbol
|
||||
address
|
||||
}}
|
||||
}
|
||||
name
|
||||
symbol
|
||||
cap
|
||||
isDatatoken
|
||||
holderCount
|
||||
orderCount
|
||||
orders(skip:0,first:1){{
|
||||
orders(skip:0, first:1) {
|
||||
amount
|
||||
serviceIndex
|
||||
payer {{
|
||||
payer {
|
||||
id
|
||||
}}
|
||||
consumer{{
|
||||
}
|
||||
consumer {
|
||||
id
|
||||
}}
|
||||
}
|
||||
estimatedUSDValue
|
||||
lastPriceToken
|
||||
lastPriceValue
|
||||
}}
|
||||
|
||||
|
||||
}}
|
||||
}}"""
|
||||
}
|
||||
}
|
||||
}"""
|
||||
|
||||
base_url = "https://v4.subgraph.mainnet.oceanprotocol.com"
|
||||
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
@ -128,7 +126,7 @@ print(json.dumps(result, indent=4, sort_keys=True))
|
||||
|
||||
**Execute script**
|
||||
|
||||
```
|
||||
```bash
|
||||
python list_all_tokens.py
|
||||
```
|
||||
{% endtab %}
|
||||
@ -175,39 +173,37 @@ Copy the query to fetch a list of datatokens in the Ocean Subgraph [GraphiQL int
|
||||
|
||||
<summary>Sample Response</summary>
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"tokens": [
|
||||
{
|
||||
"cap": null,
|
||||
"holderCount": "0",
|
||||
"id": "0x0642026e7f0b6ccac5925b4e7fa61384250e1701",
|
||||
"isDatatoken": false,
|
||||
"name": "H2O",
|
||||
"nft": null,
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": "H2O"
|
||||
},
|
||||
{
|
||||
"cap": "115792089237316195423570985008687900000000000000000000000000",
|
||||
"holderCount": "0",
|
||||
"id": "0x122d10d543bc600967b4db0f45f80cb1ddee43eb",
|
||||
"isDatatoken": true,
|
||||
"name": "Brave Lobster Token",
|
||||
"nft": {
|
||||
"address": "0xea615374949a2405c3ee555053eca4d74ec4c2f0",
|
||||
"name": "Ocean Data NFT",
|
||||
"symbol": "OCEAN-NFT"
|
||||
},
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": "BRALOB-11"
|
||||
}
|
||||
]
|
||||
}
|
||||
"data": {
|
||||
"tokens": [
|
||||
{
|
||||
"cap": null,
|
||||
"holderCount": "0",
|
||||
"id": "0x0000000000000000000000000000000000000000",
|
||||
"isDatatoken": false,
|
||||
"name": null,
|
||||
"nft": null,
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": null
|
||||
},
|
||||
{
|
||||
"cap": null,
|
||||
"holderCount": "0",
|
||||
"id": "0x0642026e7f0b6ccac5925b4e7fa61384250e1701",
|
||||
"isDatatoken": false,
|
||||
"name": "H2O",
|
||||
"nft": null,
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": "H2O"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
</details>
|
||||
|