From ac2b2abfb4b3e31d26c4ddaef23b1495a9d0737c Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 31 Jul 2022 14:51:34 +0000 Subject: [PATCH 1/8] GitBook: [#1] No subject --- SUMMARY.md | 7 ++- .../using-ocean-subgraph/README.md | 9 +++ .../examples-using-python/README.md | 2 + .../get-datatoken-information.md | 55 +++++++++++++++++++ .../examples-using-python/list-datatokens.md | 38 +++++++++++++ core-concepts/networks/bridges.md | 2 + 6 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 building-with-ocean/using-ocean-subgraph/README.md create mode 100644 building-with-ocean/using-ocean-subgraph/examples-using-python/README.md create mode 100644 building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md create mode 100644 building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md create mode 100644 core-concepts/networks/bridges.md diff --git a/SUMMARY.md b/SUMMARY.md index abb536324..dd28c9da8 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -10,7 +10,7 @@ * [Data NFTs and Datatokens](core-concepts/datanft-and-datatoken.md) * [Roles](core-concepts/roles.md) * [Networks](core-concepts/networks.md) - * [Bridges](building-with-ocean/polygon-bridge.md) + * [Bridges](core-concepts/networks/bridges.md) * [Fees](core-concepts/fees.md) * [Asset pricing](core-concepts/asset-pricing.md) * [DID & DDO](core-concepts/did-ddo.md) @@ -35,6 +35,10 @@ * [Deploying Aquarius](building-with-ocean/deploying-components/deploying-aquarius.md) * [Deploying Provider](building-with-ocean/deploying-components/deploying-provider.md) * [Deploying Ocean subgraph](building-with-ocean/deploying-components/deploying-ocean-subgraph.md) + * [Using Ocean Subgraph](building-with-ocean/using-ocean-subgraph/README.md) + * [Examples using python](building-with-ocean/using-ocean-subgraph/examples-using-python/README.md) + * [List datatokens](building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md) + * [Get datatoken information](building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md) * [Contributing](core-concepts/contributing.md) * [Contributor Code of Conduct](core-concepts/code-of-conduct.md) * [Legal Requirements](core-concepts/legal-reqs.md) @@ -42,4 +46,3 @@ * [API references](api-references/README.md) * [Aquarius REST API](api-references/aquarius-rest-api.md) * [Provider REST API](api-references/provider-rest-api.md) - diff --git a/building-with-ocean/using-ocean-subgraph/README.md b/building-with-ocean/using-ocean-subgraph/README.md new file mode 100644 index 000000000..6077b19d6 --- /dev/null +++ b/building-with-ocean/using-ocean-subgraph/README.md @@ -0,0 +1,9 @@ +--- +description: >- + Ocean subgraph is an off-chain service which provides information about + datatokens, users, balances using the GraphQL. Ocean subgraph provides a + faster way to fetch data rather than on-chain query. +--- + +# Using Ocean Subgraph + diff --git a/building-with-ocean/using-ocean-subgraph/examples-using-python/README.md b/building-with-ocean/using-ocean-subgraph/examples-using-python/README.md new file mode 100644 index 000000000..7cad5dd94 --- /dev/null +++ b/building-with-ocean/using-ocean-subgraph/examples-using-python/README.md @@ -0,0 +1,2 @@ +# Examples using python + diff --git a/building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md b/building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md new file mode 100644 index 000000000..0eac3b103 --- /dev/null +++ b/building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md @@ -0,0 +1,55 @@ +# Get datatoken information + +{% code title="datatoken_information.py" %} +```python +import requests +import json + +datatoken_address = "0x000ab98efeea06758443fdb30e376cf8b3acd305" + +query = """ +{ + datatoken(id: "{0}"){ + id + symbol + name + decimals + cap + publisher + orderCount + metadataUpdateCount + createTime + tx + orders(skip:0, first: 5, where:{datatokenId:"{0}"}) { + consumer { + id + } + timestamp + amount + marketFee + marketFeeCollector { + id + } + block + tx + } + } +}""".format( + datatoken_address +) + +print(query) + +base_url = "https://subgraph.mainnet.oceanprotocol.com" +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) +print(result) + +``` +{% endcode %} diff --git a/building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md b/building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md new file mode 100644 index 000000000..f6581d33a --- /dev/null +++ b/building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md @@ -0,0 +1,38 @@ +# List datatokens + +{% code title="list_datatokens.py" %} +```python +import requests +import json + +query = """ +{ + datatokens(skip:0, first: 5){ + id + name + symbol + address + cap + publisher + supply + holderCount + orderCount + metadataUpdateCount + orderVolume + createTime + tx + } +}""" + +base_url = "https://subgraph.mainnet.oceanprotocol.com" +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) +print(result)py +``` +{% endcode %} diff --git a/core-concepts/networks/bridges.md b/core-concepts/networks/bridges.md new file mode 100644 index 000000000..e995e7b7a --- /dev/null +++ b/core-concepts/networks/bridges.md @@ -0,0 +1,2 @@ +# Bridges + From 2404c7c0dedd226aba7a59a1989229e09611c907 Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 31 Jul 2022 15:03:42 +0000 Subject: [PATCH 2/8] GitBook: [#2] No subject --- SUMMARY.md | 1 + .../list-fixed-rate-exchanges.md | 89 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md diff --git a/SUMMARY.md b/SUMMARY.md index dd28c9da8..51c1227e9 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -39,6 +39,7 @@ * [Examples using python](building-with-ocean/using-ocean-subgraph/examples-using-python/README.md) * [List datatokens](building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md) * [Get datatoken information](building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md) + * [List Fixed Rate Exchanges](building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md) * [Contributing](core-concepts/contributing.md) * [Contributor Code of Conduct](core-concepts/code-of-conduct.md) * [Legal Requirements](core-concepts/legal-reqs.md) diff --git a/building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md b/building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md new file mode 100644 index 000000000..1f47ef54e --- /dev/null +++ b/building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md @@ -0,0 +1,89 @@ +# List Fixed Rate Exchanges + +{% swagger method="post" path="" baseUrl="https://subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph" summary="" %} +{% swagger-description %} + +{% endswagger-description %} + +{% swagger-parameter in="body" name="query" required="true" %} + +{% endswagger-parameter %} + +{% swagger-response status="200: OK" description="" %} +```javascript +{ + "data": { + "fixedRateExchanges": [ + { + "active": true, + "baseToken": "0x967da4048cd07ab37855c090aaf366e4ce1b9f48", + "datatoken": { + "address": "0xd3409d159ac9cd9c067b64f7d1bb625febf9abc2" + }, + "exchangeOwner": { + "id": "0x1d2145d078f4957b2d6f1d09cfc68fe5aa839bc7" + }, + "rate": "55", + "swaps": [] + }, + { + "active": true, + "baseToken": "0x967da4048cd07ab37855c090aaf366e4ce1b9f48", + "datatoken": { + "address": "0xca68c5e7a565ade806b081ad2326a54c390b522f" + }, + "exchangeOwner": { + "id": "0xad23fc9d943018c34ac55e8da29af700a2fd0feb" + }, + "rate": "1", + "swaps": [] + } + ] + } +} + +``` +{% endswagger-response %} +{% endswagger %} + +{% code title="list_fixed_rate_exchanges.py" %} +```python +import requests +import json + + +query = """ +{ + fixedRateExchanges{ + rate + active + baseToken + datatoken {address} + exchangeOwner { + id + } + swaps(skip:0, first: 2) { + by {id} + tx + block + dataTokenAmount + baseTokenAmount + } + } +}""" + +print(query) + +base_url = "https://subgraph.mainnet.oceanprotocol.com" +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) +print(result) + +``` +{% endcode %} From 3d3e7b012dd5a9446d2925afd31ba077f6b4b183 Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 31 Jul 2022 15:08:34 +0000 Subject: [PATCH 3/8] GitBook: [#3] No subject --- SUMMARY.md | 7 +- .../build-a-marketplace/README.md | 33 +++--- .../build-a-marketplace/deploying-market.md | 4 +- .../examples-using-python/README.md | 2 - .../get-datatoken-information.md | 0 ...d-rate-exchanges.md => list-datatokens.md} | 102 +++++++++--------- ...tokens.md => list-fixed-rate-exchanges.md} | 39 ++++--- core-concepts/did-ddo.md | 8 ++ orientation/faq.md | 76 ++++++++----- 9 files changed, 150 insertions(+), 121 deletions(-) delete mode 100644 building-with-ocean/using-ocean-subgraph/examples-using-python/README.md rename building-with-ocean/using-ocean-subgraph/{examples-using-python => }/get-datatoken-information.md (100%) rename building-with-ocean/using-ocean-subgraph/{examples-using-python/list-fixed-rate-exchanges.md => list-datatokens.md} (65%) rename building-with-ocean/using-ocean-subgraph/{examples-using-python/list-datatokens.md => list-fixed-rate-exchanges.md} (55%) diff --git a/SUMMARY.md b/SUMMARY.md index 51c1227e9..b80c2dc29 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -36,10 +36,9 @@ * [Deploying Provider](building-with-ocean/deploying-components/deploying-provider.md) * [Deploying Ocean subgraph](building-with-ocean/deploying-components/deploying-ocean-subgraph.md) * [Using Ocean Subgraph](building-with-ocean/using-ocean-subgraph/README.md) - * [Examples using python](building-with-ocean/using-ocean-subgraph/examples-using-python/README.md) - * [List datatokens](building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md) - * [Get datatoken information](building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md) - * [List Fixed Rate Exchanges](building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md) + * [List datatokens](building-with-ocean/using-ocean-subgraph/list-datatokens.md) + * [Get datatoken information](building-with-ocean/using-ocean-subgraph/get-datatoken-information.md) + * [List Fixed Rate Exchanges](building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md) * [Contributing](core-concepts/contributing.md) * [Contributor Code of Conduct](core-concepts/code-of-conduct.md) * [Legal Requirements](core-concepts/legal-reqs.md) diff --git a/building-with-ocean/build-a-marketplace/README.md b/building-with-ocean/build-a-marketplace/README.md index 970c1dd4e..82697e501 100644 --- a/building-with-ocean/build-a-marketplace/README.md +++ b/building-with-ocean/build-a-marketplace/README.md @@ -1,10 +1,10 @@ --- title: Forking Ocean Market -description: Forking and customizing Ocean Market (Frontend) featuredImage: images/creatures/mantaray/mantaray-full@2x.png +description: Forking and customizing Ocean Market (Frontend) --- -# 🐟 Forking and customizing Ocean Market +# Build a Marketplace ## Outcome @@ -20,10 +20,9 @@ Using Ocean Market is already a big improvement on the alternatives that are out The tutorial covers: -- Forking and running Ocean Market locally -- Customising your fork of Ocean market -- Quick deployment of Ocean Market - +* Forking and running Ocean Market locally +* Customising your fork of Ocean market +* Quick deployment of Ocean Market ## Preparation @@ -31,20 +30,14 @@ The tutorial covers: If you’re completely unfamiliar with Ocean Market or web3 applications in general, you will benefit from reading these guides first: -- To use your clone of Ocean Market, you’ll need a [wallet](https://docs.oceanprotocol.com/tutorials/wallets/). We recommend [getting set up with metamask](https://docs.oceanprotocol.com/tutorials/metamask-setup/). - -- You’ll also need some [Ocean tokens on a testnet](https://docs.oceanprotocol.com/tutorials/wallets-and-ocean-tokens/) to use your marketplace. - -- When you have the testnet tokens, have a go at [publishing a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-publish-data-asset/) on Ocean Market. - -- Run through the process of [consuming a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-consume-data-asset/) on Ocean Market. +* To use your clone of Ocean Market, you’ll need a [wallet](https://docs.oceanprotocol.com/tutorials/wallets/). We recommend [getting set up with metamask](https://docs.oceanprotocol.com/tutorials/metamask-setup/). +* You’ll also need some [Ocean tokens on a testnet](https://docs.oceanprotocol.com/tutorials/wallets-and-ocean-tokens/) to use your marketplace. +* When you have the testnet tokens, have a go at [publishing a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-publish-data-asset/) on Ocean Market. +* Run through the process of [consuming a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-consume-data-asset/) on Ocean Market. **Required Prerequisites** -- Git. Instructions for installing Git can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). - -- Node.js can be downloaded from [here](https://nodejs.org/en/download/) (we’re using version 16 in this guide) - -- A decent code editor, such as [Visual Studio Code](https://code.visualstudio.com/). - -- You’ll need a Github account to fork Ocean market via [Github](https://github.com/). +* Git. Instructions for installing Git can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). +* Node.js can be downloaded from [here](https://nodejs.org/en/download/) (we’re using version 16 in this guide) +* A decent code editor, such as [Visual Studio Code](https://code.visualstudio.com/). +* You’ll need a Github account to fork Ocean market via [Github](https://github.com/). diff --git a/building-with-ocean/build-a-marketplace/deploying-market.md b/building-with-ocean/build-a-marketplace/deploying-market.md index 0ff8d2a30..43bb69dc6 100644 --- a/building-with-ocean/build-a-marketplace/deploying-market.md +++ b/building-with-ocean/build-a-marketplace/deploying-market.md @@ -2,11 +2,11 @@ title: Deployment of Ocean Market order: 3 hideLanguageSelector: true -description: Step by step guide to a quick deployment of Ocean Market featuredImage: images/creatures/mantaray/mantaray-full@2x.png +description: Step by step guide to a quick deployment of Ocean Market --- -# 🔰 Quick deployment of Ocean Market +# Deploying your market All that’s left is for you to host your data marketplace and start sharing it with your future users. diff --git a/building-with-ocean/using-ocean-subgraph/examples-using-python/README.md b/building-with-ocean/using-ocean-subgraph/examples-using-python/README.md deleted file mode 100644 index 7cad5dd94..000000000 --- a/building-with-ocean/using-ocean-subgraph/examples-using-python/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Examples using python - diff --git a/building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md similarity index 100% rename from building-with-ocean/using-ocean-subgraph/examples-using-python/get-datatoken-information.md rename to building-with-ocean/using-ocean-subgraph/get-datatoken-information.md diff --git a/building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md b/building-with-ocean/using-ocean-subgraph/list-datatokens.md similarity index 65% rename from building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md rename to building-with-ocean/using-ocean-subgraph/list-datatokens.md index 1f47ef54e..c19920769 100644 --- a/building-with-ocean/using-ocean-subgraph/examples-using-python/list-fixed-rate-exchanges.md +++ b/building-with-ocean/using-ocean-subgraph/list-datatokens.md @@ -1,16 +1,59 @@ -# List Fixed Rate Exchanges +# List datatokens -{% swagger method="post" path="" baseUrl="https://subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph" summary="" %} -{% swagger-description %} +{% tabs %} +{% tab title="Python" %} +#### Create script -{% endswagger-description %} +{% code title="list_datatokens.py" %} +```python +import requests +import json + +query = """ +{ + datatokens(skip:0, first: 5){ + id + name + symbol + address + cap + publisher + supply + holderCount + orderCount + metadataUpdateCount + orderVolume + createTime + tx + } +}""" + +base_url = "https://subgraph.mainnet.oceanprotocol.com" +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) +print(result)py +``` +{% endcode %} + +#### Execute script + +``` +python list_datatokens.py +``` +{% endtab %} +{% endtabs %} -{% swagger-parameter in="body" name="query" required="true" %} +
-{% endswagger-parameter %} +Sample Response -{% swagger-response status="200: OK" description="" %} -```javascript +```json { "data": { "fixedRateExchanges": [ @@ -43,47 +86,6 @@ } ``` -{% endswagger-response %} -{% endswagger %} -{% code title="list_fixed_rate_exchanges.py" %} -```python -import requests -import json - - -query = """ -{ - fixedRateExchanges{ - rate - active - baseToken - datatoken {address} - exchangeOwner { - id - } - swaps(skip:0, first: 2) { - by {id} - tx - block - dataTokenAmount - baseTokenAmount - } - } -}""" - -print(query) +
-base_url = "https://subgraph.mainnet.oceanprotocol.com" -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) -print(result) - -``` -{% endcode %} diff --git a/building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md b/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md similarity index 55% rename from building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md rename to building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md index f6581d33a..7dd7b2c7b 100644 --- a/building-with-ocean/using-ocean-subgraph/examples-using-python/list-datatokens.md +++ b/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md @@ -1,29 +1,33 @@ -# List datatokens +# List Fixed Rate Exchanges -{% code title="list_datatokens.py" %} +{% code title="list_fixed_rate_exchanges.py" %} ```python import requests import json + query = """ { - datatokens(skip:0, first: 5){ - id - name - symbol - address - cap - publisher - supply - holderCount - orderCount - metadataUpdateCount - orderVolume - createTime - tx + fixedRateExchanges{ + rate + active + baseToken + datatoken {address} + exchangeOwner { + id + } + swaps(skip:0, first: 2) { + by {id} + tx + block + dataTokenAmount + baseTokenAmount + } } }""" +print(query) + base_url = "https://subgraph.mainnet.oceanprotocol.com" route = "/subgraphs/name/oceanprotocol/ocean-subgraph" @@ -33,6 +37,7 @@ headers = {"Content-Type": "application/json"} payload = json.dumps({"query": query}) response = requests.request("POST", url, headers=headers, data=payload) result = json.loads(response.text) -print(result)py +print(result) + ``` {% endcode %} diff --git a/core-concepts/did-ddo.md b/core-concepts/did-ddo.md index 394904141..8d50741f1 100644 --- a/core-concepts/did-ddo.md +++ b/core-concepts/did-ddo.md @@ -309,6 +309,8 @@ An asset with a service of `type` `compute` has the following additional attribu | `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. | | Type | Required | Description | | `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. | +| Type | Required | Description | +| `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

TypeRequiredDescription
booleanIf true, the algorithm job will have network access.
| | | | Type | Required | Description | | `boolean` | **✓** | If `true`, the algorithm job will have network access. | @@ -318,6 +320,8 @@ An asset with a service of `type` `compute` has the following additional attribu | `boolean` | **✓** | If `true`, the algorithm job will have network access. | | Type | Required | Description | | `boolean` | **✓** | If `true`, the algorithm job will have network access. | +| Type | Required | Description | +| `boolean` | **✓** | If `true`, the algorithm job will have network access. | |

publisherTrustedAlgorithmPublishers

TypeRequiredDescription
Array of stringIf 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.
| | | | Type | Required | Description | | 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. | @@ -327,6 +331,8 @@ An asset with a service of `type` `compute` has the following additional attribu | 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. | | Type | Required | Description | | 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. | +| Type | Required | Description | +| 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

TypeRequiredDescription
Array of publisherTrustedAlgorithmsIf 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).
| | | | Type | Required | Description | | 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). | @@ -336,6 +342,8 @@ An asset with a service of `type` `compute` has the following additional attribu | 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). | | Type | Required | Description | | 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). | +| Type | Required | Description | +| 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). | The `publisherTrustedAlgorithms` is an array of objects with the following structure: diff --git a/orientation/faq.md b/orientation/faq.md index 23b09069c..cd6d2282c 100644 --- a/orientation/faq.md +++ b/orientation/faq.md @@ -1,12 +1,12 @@ --- title: FAQs -description: Frequently Asked Questions about Ocean Protocol order: 5 hideLanguageSelector: true featuredImage: images/creatures/mantaray/mantaray-full@2x.png +description: Frequently Asked Questions about Ocean Protocol --- -# ❓ Frequently Asked Questions +# FAQ Have some questions about Ocean Protocol? @@ -15,14 +15,16 @@ Hopefully you'll find the answers here! If not then please don't hesitate to rea ### General Questions
- What is a decentralized data marketplace? + +What is a decentralized data marketplace? A data marketplace allows providers to publish data and buyers to consume data. Unlike centralized data marketplaces, decentralized ones give users more control over their data, algorithms and analytics by minimizing custodianship and providing transparent and immutable records of every transaction. With features such as Compute-to-Data (C2D), data and algorithms can be ingested into secure Docker containers where escapes avoided, protecting both the data and algorithms.
- What is needed to use a decentralized marketplace? + +What is needed to use a decentralized marketplace? Users access decentralized marketplaces via Metamask. Metamask is an applet interface that manages unique IDs, generated and controlled fully by the user. These unique IDs (aka Ethereum address) are used to store digital assets such as cryptocurrency, datatokens, NFTs and other web3 native assets. @@ -33,49 +35,56 @@ Once a user has Metamask installed and an Ethereum address, they can register, c
- How is Ocean different from other data marketplaces? + +How is Ocean different from other data marketplaces? Ocean Protocol is a decentralized data marketplace which gives users complete control of their data. The Ocean Protocol technology is built on smart contracts, decentralized computer scripts with no intermediary that are triggered by the users. The Ocean Market exposes the functionality of the smart contracts in a browser-friendly interface. Data providers and consumers can discover one another and transact in a peer-to-peer manner with the minimal amount of intermediary involvement.
- How do I price my data? + +How do I price my data? Ocean gives you two different options for pricing your data - fixed price or free. You need to decide what your dataset is worth and how you want to price it. You can change the price but you can’t change the price format (e.g. from fixed to free).
- Is my data secure? + +Is my data secure? Yes. Ocean Protocol understands that some data is too sensitive to be shared — potentially due to GDPR or other reasons. For these types of datasets, we offer a unique service called compute-to-data. This enables you to monetise the dataset that sits behind a firewall without ever revealing the raw data to the consumer. For example, researchers and data scientists pay to run their algorithms on the data set and the computation is performed behind a firewall; all the researchers or data scientists receive is the results generated by their algorithm.
- Where is my data stored? + +Where is my data stored? Ocean does not provide data storage. Users have the choice to store their data on their own servers, cloud or decentralized storage. Users need only to provide a URL to the dataset, which is then encrypted as a means to protect the access to the dataset.
- How do I control who accesses my data? + +How do I control who accesses my data? Ocean provides tools for access control, fine grained permissions, passlisting and blocklisting addresses. Data and AI services can be shared under the conditions set by the owner of data. There is no central intermediary, which ensures no one can interfere with the transaction and both the publisher and user have transparency.
- Can I restrict who is able to access my dataset? + +Can I restrict who is able to access my dataset? Yes - Ocean has implemented fine grained permissions. This means that you can create allow and deny lists that restrict access from certain individuals or limit access to particular organizations.
- What is the reach of Ocean Market - how many data buyers can I sell to? + +What is the reach of Ocean Market - how many data buyers can I sell to? Hundreds of unique datasets are available that are sourced from private individuals, research institutions, commercial enterprises and government. Publishing data on Ocean offers data providers and algorithm owners an exciting new channel to connect with a rapidly growing community of Web3 enthusiasts and data science professionals around the world. @@ -84,35 +93,40 @@ Hundreds of unique datasets are available that are sourced from private individu ### Technical Questions
- Why does Ocean Protocol use the Blockchain? + +Why does Ocean Protocol use the Blockchain? For both providers and consumers of data, blockchain is a superior substrate for building applications.Blockchain allows business logic to be instantiated in a network and triggered by the users, without intermediaries. This innovation promises lower transaction costs, higher security, more control, less errors and more transparency & auditability.
- The blockchain is public - does this mean that anyone can access my data? + +The blockchain is public - does this mean that anyone can access my data? No one is able to access data via the blockchain without purchasing access (with the datatoken) though the smart contract. Ocean smart contracts encrypt the URL to the dataset before it is published on the blockchain. This means that only the encrypted URL will be queryable in the public blockchain. Ocean technology facilitates data access to the consumer via a proxy (Ocean Provider) and the unencrypted url is never exposed.
- What is a smart contract and why is it relevant? + +What is a smart contract and why is it relevant? The blockchain can do more than just store information - it can also run code. A smart contract is an executable script that runs on the blockchain, with no intermediary and is fully transparent and auditable by anyone. In Ocean, smart contracts facilitate access to data and AI if the access conditions set out by the publisher are fulfilled.
- What is a datatoken? + +What is a datatoken? A datatoken is an access token to datasets and services published in the Ocean ecosystem. Datatokens can be purchased via the Ocean Market or on a decentralized crypto exchange. . If a consumer wishes to access a dataset, they must acquire the datatoken and then exchange the datatoken for access to the dataset.
- How do I acquire datatokens? + +How do I acquire datatokens? Datatokens can be acquired and traded in Ocean Market. There are several ways to acquire data tokens. Data publishers can acquire datatokens by publishing datasets and then receiving the generated datatokens. @@ -125,70 +139,80 @@ Datatokens can also be sent from anyone who holds a datatoken for a particular a ### Data Selling Questions
- How are organizations leveraging data sharing? + +How are organizations leveraging data sharing? For the most part organizations are leveraging data sharing to benefit from data monetization, however increasingly organizations are also sharing data in order to boost their progress on sustainability goals. For example, data aggregated from vehicles can not only bring new revenue streams to automotive firms but can also be used to battle pollution.
- Does it pay to become a marketplace operator? + +Does it pay to become a marketplace operator? Yes. Marketplace operators benefit from earning commission on marketplace transactions related to data consumption. Ocean Market is primarily focussed on monetising data however it is also designed to handle the sale of any digital asset or service. As a result the total addressable market goes way beyond revenues from just selling data. Operating costs for an Ocean-powered marketplace are moderate and the base code is open source and available free of charge under the Apache 2 license.
- Why Publish? + +Why Publish? Publishing data, algorithms and other digital assets and services on an Ocean-powered marketplace offers numerous opportunities to earn on the future revenue streams connected to that data as well as build lucrative ecosystem that add value to the published asset. It also allows for the discovery and insights into new use cases and applications of the published asset.
- What about the price fluctuation of Ocean? + +What about the price fluctuation of Ocean? Price fluctuation is mitigated through the use of the Ocean backed stable coin H2O.
- Who pays for gas fees? + +Who pays for gas fees? Gas fees for marketplace transactions are paid by the user initiating the transaction (for publishing, consuming, etc).
- Where do the docker containers run? + +Where do the docker containers run? Dockers containers can run anywhere. Ocean Market use a docker run by the Ocean Protocol Foundation OPF); limit: 1 CPU limit / 60 seconds max. NOTE: This means OPF technically has access to data. In the case of a forked Ocean-powered marketplace the owner of marketplace must set up computation environment. If individual users of the marketplace are concerned with security they should be prepared to host both the data and provide compute-to-data services on premise.
- Who pays for the computation? + +Who pays for the computation? The marketplace owner.
- What cryptocurrency do I need for transactions? + +What cryptocurrency do I need for transactions? The type if cryptocurrencies needed for transactions on the marketplace depends on which network(s) the marketplace is running (Ethereum, Polygon, EWT, BSC, Moonriver, etc.). Regardless of network, users will need to have Ocean tokens as well as the corresponding network token, which is used to pay for gas.
- Can I use the off the shelf CSS available in the repo? + +Can I use the off the shelf CSS available in the repo? Marketplace name, logo and typeface must be changed by the client. Slight modification would be enough for compliance. For more information consult the READ ME file on GitHub. https://github.com/oceanprotocol/market#-forking
- What’s to come with Ocean this year? + +What’s to come with Ocean this year? Checkout our [roadmap](https://oceanprotocol.com/technology/roadmap) to see what's we are currently working on. If you are interested in tracking our progress towards these goals then take a look at our [github](https://github.com/oceanprotocol/). From 1137416ac067a8aa742d7ca5100287e32347e3e9 Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 31 Jul 2022 15:10:11 +0000 Subject: [PATCH 4/8] GitBook: [#4] No subject --- .../build-a-marketplace/README.md | 33 ++++---- .../build-a-marketplace/deploying-market.md | 4 +- .../get-datatoken-information.md | 13 +++- core-concepts/did-ddo.md | 8 -- orientation/faq.md | 76 +++++++------------ 5 files changed, 60 insertions(+), 74 deletions(-) diff --git a/building-with-ocean/build-a-marketplace/README.md b/building-with-ocean/build-a-marketplace/README.md index 82697e501..970c1dd4e 100644 --- a/building-with-ocean/build-a-marketplace/README.md +++ b/building-with-ocean/build-a-marketplace/README.md @@ -1,10 +1,10 @@ --- title: Forking Ocean Market -featuredImage: images/creatures/mantaray/mantaray-full@2x.png description: Forking and customizing Ocean Market (Frontend) +featuredImage: images/creatures/mantaray/mantaray-full@2x.png --- -# Build a Marketplace +# 🐟 Forking and customizing Ocean Market ## Outcome @@ -20,9 +20,10 @@ Using Ocean Market is already a big improvement on the alternatives that are out The tutorial covers: -* Forking and running Ocean Market locally -* Customising your fork of Ocean market -* Quick deployment of Ocean Market +- Forking and running Ocean Market locally +- Customising your fork of Ocean market +- Quick deployment of Ocean Market + ## Preparation @@ -30,14 +31,20 @@ The tutorial covers: If you’re completely unfamiliar with Ocean Market or web3 applications in general, you will benefit from reading these guides first: -* To use your clone of Ocean Market, you’ll need a [wallet](https://docs.oceanprotocol.com/tutorials/wallets/). We recommend [getting set up with metamask](https://docs.oceanprotocol.com/tutorials/metamask-setup/). -* You’ll also need some [Ocean tokens on a testnet](https://docs.oceanprotocol.com/tutorials/wallets-and-ocean-tokens/) to use your marketplace. -* When you have the testnet tokens, have a go at [publishing a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-publish-data-asset/) on Ocean Market. -* Run through the process of [consuming a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-consume-data-asset/) on Ocean Market. +- To use your clone of Ocean Market, you’ll need a [wallet](https://docs.oceanprotocol.com/tutorials/wallets/). We recommend [getting set up with metamask](https://docs.oceanprotocol.com/tutorials/metamask-setup/). + +- You’ll also need some [Ocean tokens on a testnet](https://docs.oceanprotocol.com/tutorials/wallets-and-ocean-tokens/) to use your marketplace. + +- When you have the testnet tokens, have a go at [publishing a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-publish-data-asset/) on Ocean Market. + +- Run through the process of [consuming a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-consume-data-asset/) on Ocean Market. **Required Prerequisites** -* Git. Instructions for installing Git can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). -* Node.js can be downloaded from [here](https://nodejs.org/en/download/) (we’re using version 16 in this guide) -* A decent code editor, such as [Visual Studio Code](https://code.visualstudio.com/). -* You’ll need a Github account to fork Ocean market via [Github](https://github.com/). +- Git. Instructions for installing Git can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). + +- Node.js can be downloaded from [here](https://nodejs.org/en/download/) (we’re using version 16 in this guide) + +- A decent code editor, such as [Visual Studio Code](https://code.visualstudio.com/). + +- You’ll need a Github account to fork Ocean market via [Github](https://github.com/). diff --git a/building-with-ocean/build-a-marketplace/deploying-market.md b/building-with-ocean/build-a-marketplace/deploying-market.md index 43bb69dc6..0ff8d2a30 100644 --- a/building-with-ocean/build-a-marketplace/deploying-market.md +++ b/building-with-ocean/build-a-marketplace/deploying-market.md @@ -2,11 +2,11 @@ title: Deployment of Ocean Market order: 3 hideLanguageSelector: true -featuredImage: images/creatures/mantaray/mantaray-full@2x.png description: Step by step guide to a quick deployment of Ocean Market +featuredImage: images/creatures/mantaray/mantaray-full@2x.png --- -# Deploying your market +# 🔰 Quick deployment of Ocean Market All that’s left is for you to host your data marketplace and start sharing it with your future users. diff --git a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md index 0eac3b103..08278171f 100644 --- a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md +++ b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md @@ -1,5 +1,9 @@ # Get datatoken information +{% tabs %} +{% tab title="Python" %} +#### Create script + {% code title="datatoken_information.py" %} ```python import requests @@ -50,6 +54,13 @@ payload = json.dumps({"query": query}) response = requests.request("POST", url, headers=headers, data=payload) result = json.loads(response.text) print(result) - ``` {% endcode %} + +#### Execute script + +``` +python datatoken_information.py +``` +{% endtab %} +{% endtabs %} diff --git a/core-concepts/did-ddo.md b/core-concepts/did-ddo.md index 8d50741f1..394904141 100644 --- a/core-concepts/did-ddo.md +++ b/core-concepts/did-ddo.md @@ -309,8 +309,6 @@ An asset with a service of `type` `compute` has the following additional attribu | `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. | | Type | Required | Description | | `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. | -| Type | Required | Description | -| `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

TypeRequiredDescription
booleanIf true, the algorithm job will have network access.
| | | | Type | Required | Description | | `boolean` | **✓** | If `true`, the algorithm job will have network access. | @@ -320,8 +318,6 @@ An asset with a service of `type` `compute` has the following additional attribu | `boolean` | **✓** | If `true`, the algorithm job will have network access. | | Type | Required | Description | | `boolean` | **✓** | If `true`, the algorithm job will have network access. | -| Type | Required | Description | -| `boolean` | **✓** | If `true`, the algorithm job will have network access. | |

publisherTrustedAlgorithmPublishers

TypeRequiredDescription
Array of stringIf 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.
| | | | Type | Required | Description | | 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. | @@ -331,8 +327,6 @@ An asset with a service of `type` `compute` has the following additional attribu | 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. | | Type | Required | Description | | 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. | -| Type | Required | Description | -| 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

TypeRequiredDescription
Array of publisherTrustedAlgorithmsIf 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).
| | | | Type | Required | Description | | 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). | @@ -342,8 +336,6 @@ An asset with a service of `type` `compute` has the following additional attribu | 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). | | Type | Required | Description | | 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). | -| Type | Required | Description | -| 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). | The `publisherTrustedAlgorithms` is an array of objects with the following structure: diff --git a/orientation/faq.md b/orientation/faq.md index cd6d2282c..23b09069c 100644 --- a/orientation/faq.md +++ b/orientation/faq.md @@ -1,12 +1,12 @@ --- title: FAQs +description: Frequently Asked Questions about Ocean Protocol order: 5 hideLanguageSelector: true featuredImage: images/creatures/mantaray/mantaray-full@2x.png -description: Frequently Asked Questions about Ocean Protocol --- -# FAQ +# ❓ Frequently Asked Questions Have some questions about Ocean Protocol? @@ -15,16 +15,14 @@ Hopefully you'll find the answers here! If not then please don't hesitate to rea ### General Questions
- -What is a decentralized data marketplace? + What is a decentralized data marketplace? A data marketplace allows providers to publish data and buyers to consume data. Unlike centralized data marketplaces, decentralized ones give users more control over their data, algorithms and analytics by minimizing custodianship and providing transparent and immutable records of every transaction. With features such as Compute-to-Data (C2D), data and algorithms can be ingested into secure Docker containers where escapes avoided, protecting both the data and algorithms.
- -What is needed to use a decentralized marketplace? + What is needed to use a decentralized marketplace? Users access decentralized marketplaces via Metamask. Metamask is an applet interface that manages unique IDs, generated and controlled fully by the user. These unique IDs (aka Ethereum address) are used to store digital assets such as cryptocurrency, datatokens, NFTs and other web3 native assets. @@ -35,56 +33,49 @@ Once a user has Metamask installed and an Ethereum address, they can register, c
- -How is Ocean different from other data marketplaces? + How is Ocean different from other data marketplaces? Ocean Protocol is a decentralized data marketplace which gives users complete control of their data. The Ocean Protocol technology is built on smart contracts, decentralized computer scripts with no intermediary that are triggered by the users. The Ocean Market exposes the functionality of the smart contracts in a browser-friendly interface. Data providers and consumers can discover one another and transact in a peer-to-peer manner with the minimal amount of intermediary involvement.
- -How do I price my data? + How do I price my data? Ocean gives you two different options for pricing your data - fixed price or free. You need to decide what your dataset is worth and how you want to price it. You can change the price but you can’t change the price format (e.g. from fixed to free).
- -Is my data secure? + Is my data secure? Yes. Ocean Protocol understands that some data is too sensitive to be shared — potentially due to GDPR or other reasons. For these types of datasets, we offer a unique service called compute-to-data. This enables you to monetise the dataset that sits behind a firewall without ever revealing the raw data to the consumer. For example, researchers and data scientists pay to run their algorithms on the data set and the computation is performed behind a firewall; all the researchers or data scientists receive is the results generated by their algorithm.
- -Where is my data stored? + Where is my data stored? Ocean does not provide data storage. Users have the choice to store their data on their own servers, cloud or decentralized storage. Users need only to provide a URL to the dataset, which is then encrypted as a means to protect the access to the dataset.
- -How do I control who accesses my data? + How do I control who accesses my data? Ocean provides tools for access control, fine grained permissions, passlisting and blocklisting addresses. Data and AI services can be shared under the conditions set by the owner of data. There is no central intermediary, which ensures no one can interfere with the transaction and both the publisher and user have transparency.
- -Can I restrict who is able to access my dataset? + Can I restrict who is able to access my dataset? Yes - Ocean has implemented fine grained permissions. This means that you can create allow and deny lists that restrict access from certain individuals or limit access to particular organizations.
- -What is the reach of Ocean Market - how many data buyers can I sell to? + What is the reach of Ocean Market - how many data buyers can I sell to? Hundreds of unique datasets are available that are sourced from private individuals, research institutions, commercial enterprises and government. Publishing data on Ocean offers data providers and algorithm owners an exciting new channel to connect with a rapidly growing community of Web3 enthusiasts and data science professionals around the world. @@ -93,40 +84,35 @@ Hundreds of unique datasets are available that are sourced from private individu ### Technical Questions
- -Why does Ocean Protocol use the Blockchain? + Why does Ocean Protocol use the Blockchain? For both providers and consumers of data, blockchain is a superior substrate for building applications.Blockchain allows business logic to be instantiated in a network and triggered by the users, without intermediaries. This innovation promises lower transaction costs, higher security, more control, less errors and more transparency & auditability.
- -The blockchain is public - does this mean that anyone can access my data? + The blockchain is public - does this mean that anyone can access my data? No one is able to access data via the blockchain without purchasing access (with the datatoken) though the smart contract. Ocean smart contracts encrypt the URL to the dataset before it is published on the blockchain. This means that only the encrypted URL will be queryable in the public blockchain. Ocean technology facilitates data access to the consumer via a proxy (Ocean Provider) and the unencrypted url is never exposed.
- -What is a smart contract and why is it relevant? + What is a smart contract and why is it relevant? The blockchain can do more than just store information - it can also run code. A smart contract is an executable script that runs on the blockchain, with no intermediary and is fully transparent and auditable by anyone. In Ocean, smart contracts facilitate access to data and AI if the access conditions set out by the publisher are fulfilled.
- -What is a datatoken? + What is a datatoken? A datatoken is an access token to datasets and services published in the Ocean ecosystem. Datatokens can be purchased via the Ocean Market or on a decentralized crypto exchange. . If a consumer wishes to access a dataset, they must acquire the datatoken and then exchange the datatoken for access to the dataset.
- -How do I acquire datatokens? + How do I acquire datatokens? Datatokens can be acquired and traded in Ocean Market. There are several ways to acquire data tokens. Data publishers can acquire datatokens by publishing datasets and then receiving the generated datatokens. @@ -139,80 +125,70 @@ Datatokens can also be sent from anyone who holds a datatoken for a particular a ### Data Selling Questions
- -How are organizations leveraging data sharing? + How are organizations leveraging data sharing? For the most part organizations are leveraging data sharing to benefit from data monetization, however increasingly organizations are also sharing data in order to boost their progress on sustainability goals. For example, data aggregated from vehicles can not only bring new revenue streams to automotive firms but can also be used to battle pollution.
- -Does it pay to become a marketplace operator? + Does it pay to become a marketplace operator? Yes. Marketplace operators benefit from earning commission on marketplace transactions related to data consumption. Ocean Market is primarily focussed on monetising data however it is also designed to handle the sale of any digital asset or service. As a result the total addressable market goes way beyond revenues from just selling data. Operating costs for an Ocean-powered marketplace are moderate and the base code is open source and available free of charge under the Apache 2 license.
- -Why Publish? + Why Publish? Publishing data, algorithms and other digital assets and services on an Ocean-powered marketplace offers numerous opportunities to earn on the future revenue streams connected to that data as well as build lucrative ecosystem that add value to the published asset. It also allows for the discovery and insights into new use cases and applications of the published asset.
- -What about the price fluctuation of Ocean? + What about the price fluctuation of Ocean? Price fluctuation is mitigated through the use of the Ocean backed stable coin H2O.
- -Who pays for gas fees? + Who pays for gas fees? Gas fees for marketplace transactions are paid by the user initiating the transaction (for publishing, consuming, etc).
- -Where do the docker containers run? + Where do the docker containers run? Dockers containers can run anywhere. Ocean Market use a docker run by the Ocean Protocol Foundation OPF); limit: 1 CPU limit / 60 seconds max. NOTE: This means OPF technically has access to data. In the case of a forked Ocean-powered marketplace the owner of marketplace must set up computation environment. If individual users of the marketplace are concerned with security they should be prepared to host both the data and provide compute-to-data services on premise.
- -Who pays for the computation? + Who pays for the computation? The marketplace owner.
- -What cryptocurrency do I need for transactions? + What cryptocurrency do I need for transactions? The type if cryptocurrencies needed for transactions on the marketplace depends on which network(s) the marketplace is running (Ethereum, Polygon, EWT, BSC, Moonriver, etc.). Regardless of network, users will need to have Ocean tokens as well as the corresponding network token, which is used to pay for gas.
- -Can I use the off the shelf CSS available in the repo? + Can I use the off the shelf CSS available in the repo? Marketplace name, logo and typeface must be changed by the client. Slight modification would be enough for compliance. For more information consult the READ ME file on GitHub. https://github.com/oceanprotocol/market#-forking
- -What’s to come with Ocean this year? + What’s to come with Ocean this year? Checkout our [roadmap](https://oceanprotocol.com/technology/roadmap) to see what's we are currently working on. If you are interested in tracking our progress towards these goals then take a look at our [github](https://github.com/oceanprotocol/). From 50f4e917292b6e2861502e8d178574222267d79c Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 31 Jul 2022 15:35:19 +0000 Subject: [PATCH 5/8] GitBook: [#5] No subject --- .../get-datatoken-information.md | 58 +++++++++--- .../using-ocean-subgraph/list-datatokens.md | 93 ++++++++++++++----- .../list-fixed-rate-exchanges.md | 52 +++++++++++ 3 files changed, 168 insertions(+), 35 deletions(-) diff --git a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md index 08278171f..a2a657339 100644 --- a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md +++ b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md @@ -10,10 +10,9 @@ import requests import json datatoken_address = "0x000ab98efeea06758443fdb30e376cf8b3acd305" - query = """ -{ - datatoken(id: "{0}"){ +{{ + datatoken(id: "{0}"){{ id symbol name @@ -24,26 +23,24 @@ query = """ metadataUpdateCount createTime tx - orders(skip:0, first: 5, where:{datatokenId:"{0}"}) { - consumer { + orders(skip:0, first: 5, where:{{datatokenId:"{0}"}}) {{ + consumer {{ id - } + }} timestamp amount marketFee - marketFeeCollector { + marketFeeCollector {{ id - } + }} block tx - } - } -}""".format( + }} + }} +}}""".format( datatoken_address ) -print(query) - base_url = "https://subgraph.mainnet.oceanprotocol.com" route = "/subgraphs/name/oceanprotocol/ocean-subgraph" @@ -53,7 +50,13 @@ headers = {"Content-Type": "application/json"} payload = json.dumps({"query": query}) response = requests.request("POST", url, headers=headers, data=payload) result = json.loads(response.text) -print(result) + +print(url) + +print(payload) + +print(json.dumps(result, indent=4, sort_keys=True)) + ``` {% endcode %} @@ -64,3 +67,30 @@ python datatoken_information.py ``` {% endtab %} {% endtabs %} + +
+ +Sample response + +```json +{ + "data": { + "datatoken": { + "cap": "1000", + "createTime": 1657244700, + "decimals": 18, + "id": "0x000ab98efeea06758443fdb30e376cf8b3acd305", + "metadataUpdateCount": "1", + "name": "Breathtaking Crab Token", + "orderCount": "0", + "orders": [], + "publisher": "0x89717015882d6460e4a0daeb945b3d4032f2d9d6", + "symbol": "BRECRA-81", + "tx": "0xb67c9e193e62bdbc7313399c6d38450037f432a06ee615a368a794bf716d1476" + } + } +} + +``` + +
diff --git a/building-with-ocean/using-ocean-subgraph/list-datatokens.md b/building-with-ocean/using-ocean-subgraph/list-datatokens.md index c19920769..3e2ac58b9 100644 --- a/building-with-ocean/using-ocean-subgraph/list-datatokens.md +++ b/building-with-ocean/using-ocean-subgraph/list-datatokens.md @@ -56,30 +56,81 @@ python list_datatokens.py ```json { "data": { - "fixedRateExchanges": [ + "datatokens": [ { - "active": true, - "baseToken": "0x967da4048cd07ab37855c090aaf366e4ce1b9f48", - "datatoken": { - "address": "0xd3409d159ac9cd9c067b64f7d1bb625febf9abc2" - }, - "exchangeOwner": { - "id": "0x1d2145d078f4957b2d6f1d09cfc68fe5aa839bc7" - }, - "rate": "55", - "swaps": [] + "address": "0x000ab98efeea06758443fdb30e376cf8b3acd305", + "cap": "1000", + "createTime": 1657244700, + "holderCount": "0", + "id": "0x000ab98efeea06758443fdb30e376cf8b3acd305", + "metadataUpdateCount": "1", + "name": "Breathtaking Crab Token", + "orderCount": "0", + "orderVolume": "0", + "publisher": "0x89717015882d6460e4a0daeb945b3d4032f2d9d6", + "supply": "9.375", + "symbol": "BRECRA-81", + "tx": "0xb67c9e193e62bdbc7313399c6d38450037f432a06ee615a368a794bf716d1476" }, { - "active": true, - "baseToken": "0x967da4048cd07ab37855c090aaf366e4ce1b9f48", - "datatoken": { - "address": "0xca68c5e7a565ade806b081ad2326a54c390b522f" - }, - "exchangeOwner": { - "id": "0xad23fc9d943018c34ac55e8da29af700a2fd0feb" - }, - "rate": "1", - "swaps": [] + "address": "0x003af2cdcd9b0bfb56db4166abea7c860f0cdfdc", + "cap": "1000", + "createTime": 1604832656, + "holderCount": "0", + "id": "0x003af2cdcd9b0bfb56db4166abea7c860f0cdfdc", + "metadataUpdateCount": "1", + "name": "Juicy Lobster Token", + "orderCount": "0", + "orderVolume": "0", + "publisher": "0xfebd01993009d3d19049b7186dabd4b49eba15c8", + "supply": "9.078947368421053", + "symbol": "JUILOB-15", + "tx": "0x23dbf414b653f67db437bee0f5f4e8a491bea297b5763d2b9b3ddb454c381df5" + }, + { + "address": "0x00d75f1dadaf1cfd77c1c16180b14fcf0c22d859", + "cap": "1000", + "createTime": 1606135635, + "holderCount": "0", + "id": "0x00d75f1dadaf1cfd77c1c16180b14fcf0c22d859", + "metadataUpdateCount": "1", + "name": "Defamatory Fish Token", + "orderCount": "1", + "orderVolume": "1", + "publisher": "0xa5532218769800392408144ab3cafcbea0fd563d", + "supply": "1000", + "symbol": "DEFFIS-59", + "tx": "0x63e4ae50052c35c18612f3b90a6c02c7a5f184281bbbb5bd80c9d37de0b04af2" + }, + { + "address": "0x0113b54135e2be4c919ab6fd3c28ead798f7e83f", + "cap": "1000", + "createTime": 1603921926, + "holderCount": "0", + "id": "0x0113b54135e2be4c919ab6fd3c28ead798f7e83f", + "metadataUpdateCount": "0", + "name": "Jocular Otter Token", + "orderCount": "0", + "orderVolume": "0", + "publisher": "0x13496a822830d5e8087d6b216af8919dd03a5ceb", + "supply": "0", + "symbol": "JOCOTT-98", + "tx": "0x1bbe4ce8ac0eb6e9db6cba5a406c03e94f9244bd226ba65f87ea34b50dd0186f" + }, + { + "address": "0x018dc6c33e66381cd29ce13c176d9414cfa5cd05", + "cap": "1000", + "createTime": 1604303120, + "holderCount": "0", + "id": "0x018dc6c33e66381cd29ce13c176d9414cfa5cd05", + "metadataUpdateCount": "0", + "name": "Ubiquitous Mackerel Token", + "orderCount": "0", + "orderVolume": "0", + "publisher": "0xde828bfa26f82f9394d7f3a315133933ef523ae1", + "supply": "0", + "symbol": "UBIMAC-9", + "tx": "0x46e853b4938d7a554f29b6f00e7458021dee2f0ac19085d1d207def8ad407896" } ] } diff --git a/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md b/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md index 7dd7b2c7b..ebd11a2e2 100644 --- a/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md +++ b/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md @@ -1,5 +1,9 @@ # List Fixed Rate Exchanges +{% tabs %} +{% tab title="Python" %} +#### Create script + {% code title="list_fixed_rate_exchanges.py" %} ```python import requests @@ -41,3 +45,51 @@ print(result) ``` {% endcode %} + +#### Execute script + +``` +python list_fixed_rate_exchanges.py +``` +{% endtab %} +{% endtabs %} + +
+ +Sample response + +```json +{ + "data": { + "fixedRateExchanges": [ + { + "active": true, + "baseToken": "0x967da4048cd07ab37855c090aaf366e4ce1b9f48", + "datatoken": { + "address": "0xd3409d159ac9cd9c067b64f7d1bb625febf9abc2" + }, + "exchangeOwner": { + "id": "0x1d2145d078f4957b2d6f1d09cfc68fe5aa839bc7" + }, + "rate": "55", + "swaps": [] + }, + { + "active": true, + "baseToken": "0x967da4048cd07ab37855c090aaf366e4ce1b9f48", + "datatoken": { + "address": "0xca68c5e7a565ade806b081ad2326a54c390b522f" + }, + "exchangeOwner": { + "id": "0xad23fc9d943018c34ac55e8da29af700a2fd0feb" + }, + "rate": "1", + "swaps": [] + } + ] + } +} +json +``` + +
From 9e94f2d565f1113cf87393de7e9497871528ceed Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 31 Jul 2022 21:48:40 +0000 Subject: [PATCH 6/8] GitBook: [#6] Subgraph examples --- SUMMARY.md | 4 +- .../build-a-marketplace/README.md | 33 ++- .../build-a-marketplace/deploying-market.md | 4 +- .../using-ocean-subgraph/README.md | 1 + .../get-data-nft-information.md | 126 +++++++++++ .../get-datatoken-information.md | 136 ++++++++---- .../using-ocean-subgraph/list-all-tokens.md | 146 +++++++++++++ .../using-ocean-subgraph/list-datatokens.md | 142 ------------- .../list-fixed-rate-exchanges.md | 159 ++++++++++---- .../using-ocean-subgraph/list-nfts.md | 195 ++++++++++++++++++ core-concepts/did-ddo.md | 8 + orientation/faq.md | 76 ++++--- 12 files changed, 763 insertions(+), 267 deletions(-) create mode 100644 building-with-ocean/using-ocean-subgraph/get-data-nft-information.md create mode 100644 building-with-ocean/using-ocean-subgraph/list-all-tokens.md delete mode 100644 building-with-ocean/using-ocean-subgraph/list-datatokens.md create mode 100644 building-with-ocean/using-ocean-subgraph/list-nfts.md diff --git a/SUMMARY.md b/SUMMARY.md index b80c2dc29..ae4e9da76 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -36,7 +36,9 @@ * [Deploying Provider](building-with-ocean/deploying-components/deploying-provider.md) * [Deploying Ocean subgraph](building-with-ocean/deploying-components/deploying-ocean-subgraph.md) * [Using Ocean Subgraph](building-with-ocean/using-ocean-subgraph/README.md) - * [List datatokens](building-with-ocean/using-ocean-subgraph/list-datatokens.md) + * [List NFTs](building-with-ocean/using-ocean-subgraph/list-nfts.md) + * [List all tokens](building-with-ocean/using-ocean-subgraph/list-all-tokens.md) + * [Get data NFT information](building-with-ocean/using-ocean-subgraph/get-data-nft-information.md) * [Get datatoken information](building-with-ocean/using-ocean-subgraph/get-datatoken-information.md) * [List Fixed Rate Exchanges](building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md) * [Contributing](core-concepts/contributing.md) diff --git a/building-with-ocean/build-a-marketplace/README.md b/building-with-ocean/build-a-marketplace/README.md index 970c1dd4e..82697e501 100644 --- a/building-with-ocean/build-a-marketplace/README.md +++ b/building-with-ocean/build-a-marketplace/README.md @@ -1,10 +1,10 @@ --- title: Forking Ocean Market -description: Forking and customizing Ocean Market (Frontend) featuredImage: images/creatures/mantaray/mantaray-full@2x.png +description: Forking and customizing Ocean Market (Frontend) --- -# 🐟 Forking and customizing Ocean Market +# Build a Marketplace ## Outcome @@ -20,10 +20,9 @@ Using Ocean Market is already a big improvement on the alternatives that are out The tutorial covers: -- Forking and running Ocean Market locally -- Customising your fork of Ocean market -- Quick deployment of Ocean Market - +* Forking and running Ocean Market locally +* Customising your fork of Ocean market +* Quick deployment of Ocean Market ## Preparation @@ -31,20 +30,14 @@ The tutorial covers: If you’re completely unfamiliar with Ocean Market or web3 applications in general, you will benefit from reading these guides first: -- To use your clone of Ocean Market, you’ll need a [wallet](https://docs.oceanprotocol.com/tutorials/wallets/). We recommend [getting set up with metamask](https://docs.oceanprotocol.com/tutorials/metamask-setup/). - -- You’ll also need some [Ocean tokens on a testnet](https://docs.oceanprotocol.com/tutorials/wallets-and-ocean-tokens/) to use your marketplace. - -- When you have the testnet tokens, have a go at [publishing a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-publish-data-asset/) on Ocean Market. - -- Run through the process of [consuming a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-consume-data-asset/) on Ocean Market. +* To use your clone of Ocean Market, you’ll need a [wallet](https://docs.oceanprotocol.com/tutorials/wallets/). We recommend [getting set up with metamask](https://docs.oceanprotocol.com/tutorials/metamask-setup/). +* You’ll also need some [Ocean tokens on a testnet](https://docs.oceanprotocol.com/tutorials/wallets-and-ocean-tokens/) to use your marketplace. +* When you have the testnet tokens, have a go at [publishing a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-publish-data-asset/) on Ocean Market. +* Run through the process of [consuming a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-consume-data-asset/) on Ocean Market. **Required Prerequisites** -- Git. Instructions for installing Git can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). - -- Node.js can be downloaded from [here](https://nodejs.org/en/download/) (we’re using version 16 in this guide) - -- A decent code editor, such as [Visual Studio Code](https://code.visualstudio.com/). - -- You’ll need a Github account to fork Ocean market via [Github](https://github.com/). +* Git. Instructions for installing Git can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). +* Node.js can be downloaded from [here](https://nodejs.org/en/download/) (we’re using version 16 in this guide) +* A decent code editor, such as [Visual Studio Code](https://code.visualstudio.com/). +* You’ll need a Github account to fork Ocean market via [Github](https://github.com/). diff --git a/building-with-ocean/build-a-marketplace/deploying-market.md b/building-with-ocean/build-a-marketplace/deploying-market.md index 0ff8d2a30..43bb69dc6 100644 --- a/building-with-ocean/build-a-marketplace/deploying-market.md +++ b/building-with-ocean/build-a-marketplace/deploying-market.md @@ -2,11 +2,11 @@ title: Deployment of Ocean Market order: 3 hideLanguageSelector: true -description: Step by step guide to a quick deployment of Ocean Market featuredImage: images/creatures/mantaray/mantaray-full@2x.png +description: Step by step guide to a quick deployment of Ocean Market --- -# 🔰 Quick deployment of Ocean Market +# Deploying your market All that’s left is for you to host your data marketplace and start sharing it with your future users. diff --git a/building-with-ocean/using-ocean-subgraph/README.md b/building-with-ocean/using-ocean-subgraph/README.md index 6077b19d6..10409898e 100644 --- a/building-with-ocean/using-ocean-subgraph/README.md +++ b/building-with-ocean/using-ocean-subgraph/README.md @@ -7,3 +7,4 @@ description: >- # Using Ocean Subgraph +For each supported network, an individual Ocean subgraph is deployed. The information about supported networks and the subgraph URL is available on [this page](../../core-concepts/networks.md). diff --git a/building-with-ocean/using-ocean-subgraph/get-data-nft-information.md b/building-with-ocean/using-ocean-subgraph/get-data-nft-information.md new file mode 100644 index 000000000..9938fd928 --- /dev/null +++ b/building-with-ocean/using-ocean-subgraph/get-data-nft-information.md @@ -0,0 +1,126 @@ +# Get data NFT information + +The result of following GraphQL query returns the information about a particular datatoken. Here, 0x1c161d721e6d99f58d47f709cdc77025056c544c is the address of the dataNFT. + +```graphql +{ + nft (id:"0x1c161d721e6d99f58d47f709cdc77025056c544c", subgraphError:deny){ + id + name + symbol + owner + address + assetState + tx + block + transferable + creator + createdTimestamp + providerUrl + managerRole + erc20DeployerRole + storeUpdateRole + metadataRole + tokenUri + template + orderCount + } +}b +``` + +The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. Change the value of the variable dataNFT\_address with the address of the datatoken of your choice. + +{% tabs %} +{% tab title="Python" %} +{% code title="dataNFT_information.py" %} +```python +import requests +import json + +dataNFT_address = "0x1c161d721e6d99f58d47f709cdc77025056c544c" +query = """ +{{ + nft (id:"{0}", subgraphError:deny){{ + id + name + symbol + owner + address + assetState + tx + block + transferable + creator + createdTimestamp + providerUrl + managerRole + erc20DeployerRole + storeUpdateRole + metadataRole + tokenUri + template + orderCount + }} +}}""".format( + dataNFT_address +) + +base_url = "https://v4.subgraph.mainnet.oceanprotocol.com" +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) + +print(json.dumps(result, indent=4, sort_keys=True)) +``` +{% endcode %} + +#### Execute script + +``` +python dataNFT_information.py +``` +{% endtab %} +{% endtabs %} + +
+ +Sample response + +```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": "", + "transferable": true, + "tx": "0x327a9da0d2e9df945fd2f8e10b1caa77acf98e803c5a2f588597172a0bcbb93a" + } + } +} +``` + +
diff --git a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md index a2a657339..891200d16 100644 --- a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md +++ b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md @@ -1,5 +1,49 @@ # Get datatoken information + + +The result of following GraphQL query returns the information about a particular datatoken. Here, `0x122d10d543bc600967b4db0f45f80cb1ddee43eb` is the address of the datatoken. + +```graphql +{ + token(id:"0x122d10d543bc600967b4db0f45f80cb1ddee43eb", subgraphError: deny){ + id + symbol + nft { + name + symbol + address + } + name + symbol + cap + isDatatoken + holderCount + orderCount + orders(skip:0,first:1){ + amount + serviceIndex + payer { + id + } + consumer{ + id + } + estimatedUSDValue + lastPriceToken + lastPriceValue + } + } + fixedRateExchanges(subgraphError:deny){ + id + price + active + } +} +``` + +The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. Change the value of the variable `datatoken_address` with the address of the datatoken of your choice. + {% tabs %} {% tab title="Python" %} #### Create script @@ -9,39 +53,47 @@ import requests import json -datatoken_address = "0x000ab98efeea06758443fdb30e376cf8b3acd305" +datatoken_address = "0x122d10d543bc600967b4db0f45f80cb1ddee43eb" query = """ {{ - datatoken(id: "{0}"){{ + token(id:"{0}", subgraphError: deny){{ id symbol + nft {{ + name + symbol + address + }} name - decimals + symbol cap - publisher + isDatatoken + holderCount orderCount - metadataUpdateCount - createTime - tx - orders(skip:0, first: 5, where:{{datatokenId:"{0}"}}) {{ - consumer {{ + orders(skip:0,first:1){{ + amount + serviceIndex + payer {{ id }} - timestamp - amount - marketFee - marketFeeCollector {{ + consumer{{ id }} - block - tx + estimatedUSDValue + lastPriceToken + lastPriceValue }} }} + fixedRateExchanges(subgraphError:deny){{ + id + price + active + }} }}""".format( datatoken_address ) -base_url = "https://subgraph.mainnet.oceanprotocol.com" +base_url = "https://v4.subgraph.mainnet.oceanprotocol.com/" route = "/subgraphs/name/oceanprotocol/ocean-subgraph" url = base_url + route @@ -51,10 +103,6 @@ payload = json.dumps({"query": query}) response = requests.request("POST", url, headers=headers, data=payload) result = json.loads(response.text) -print(url) - -print(payload) - print(json.dumps(result, indent=4, sort_keys=True)) ``` @@ -74,23 +122,41 @@ python datatoken_information.py ```json { - "data": { - "datatoken": { - "cap": "1000", - "createTime": 1657244700, - "decimals": 18, - "id": "0x000ab98efeea06758443fdb30e376cf8b3acd305", - "metadataUpdateCount": "1", - "name": "Breathtaking Crab Token", - "orderCount": "0", - "orders": [], - "publisher": "0x89717015882d6460e4a0daeb945b3d4032f2d9d6", - "symbol": "BRECRA-81", - "tx": "0xb67c9e193e62bdbc7313399c6d38450037f432a06ee615a368a794bf716d1476" - } + "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" } + } } - ```
diff --git a/building-with-ocean/using-ocean-subgraph/list-all-tokens.md b/building-with-ocean/using-ocean-subgraph/list-all-tokens.md new file mode 100644 index 000000000..4aaeb5013 --- /dev/null +++ b/building-with-ocean/using-ocean-subgraph/list-all-tokens.md @@ -0,0 +1,146 @@ +# List all tokens + +The result of following GraphQL query returns the information about datatokens. + +```graphql +{ + tokens(skip:0, first: 2, subgraphError: deny){ + id + symbol + nft { + name + symbol + address + } + name + symbol + cap + isDatatoken + holderCount + orderCount + orders(skip:0,first:1){ + amount + serviceIndex + payer { + id + } + consumer{ + id + } + estimatedUSDValue + lastPriceToken + lastPriceValue + } + } +} +``` + +The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. + +{% tabs %} +{% tab title="Python" %} +#### Create script + +{% code title="list_all_tokens.py" %} +```python +import requests +import json + +query = """ +{{ + tokens(skip:0, first: 2, subgraphError: deny){{ + id + symbol + nft {{ + name + symbol + address + }} + name + symbol + cap + isDatatoken + holderCount + orderCount + orders(skip:0,first:1){{ + amount + serviceIndex + payer {{ + id + }} + consumer{{ + id + }} + estimatedUSDValue + lastPriceToken + lastPriceValue + }} + + + }} +}}""" + +base_url = "https://v4.subgraph.mainnet.oceanprotocol.com" +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) + +print(json.dumps(result, indent=4, sort_keys=True)) + +``` +{% endcode %} + +#### Execute script + +``` +python list_all_tokens.py +``` +{% endtab %} +{% endtabs %} + +
+ +Sample Response + +```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" + } + ] + } +} +``` + +
+ diff --git a/building-with-ocean/using-ocean-subgraph/list-datatokens.md b/building-with-ocean/using-ocean-subgraph/list-datatokens.md deleted file mode 100644 index 3e2ac58b9..000000000 --- a/building-with-ocean/using-ocean-subgraph/list-datatokens.md +++ /dev/null @@ -1,142 +0,0 @@ -# List datatokens - -{% tabs %} -{% tab title="Python" %} -#### Create script - -{% code title="list_datatokens.py" %} -```python -import requests -import json - -query = """ -{ - datatokens(skip:0, first: 5){ - id - name - symbol - address - cap - publisher - supply - holderCount - orderCount - metadataUpdateCount - orderVolume - createTime - tx - } -}""" - -base_url = "https://subgraph.mainnet.oceanprotocol.com" -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) -print(result)py -``` -{% endcode %} - -#### Execute script - -``` -python list_datatokens.py -``` -{% endtab %} -{% endtabs %} - -
- -Sample Response - -```json -{ - "data": { - "datatokens": [ - { - "address": "0x000ab98efeea06758443fdb30e376cf8b3acd305", - "cap": "1000", - "createTime": 1657244700, - "holderCount": "0", - "id": "0x000ab98efeea06758443fdb30e376cf8b3acd305", - "metadataUpdateCount": "1", - "name": "Breathtaking Crab Token", - "orderCount": "0", - "orderVolume": "0", - "publisher": "0x89717015882d6460e4a0daeb945b3d4032f2d9d6", - "supply": "9.375", - "symbol": "BRECRA-81", - "tx": "0xb67c9e193e62bdbc7313399c6d38450037f432a06ee615a368a794bf716d1476" - }, - { - "address": "0x003af2cdcd9b0bfb56db4166abea7c860f0cdfdc", - "cap": "1000", - "createTime": 1604832656, - "holderCount": "0", - "id": "0x003af2cdcd9b0bfb56db4166abea7c860f0cdfdc", - "metadataUpdateCount": "1", - "name": "Juicy Lobster Token", - "orderCount": "0", - "orderVolume": "0", - "publisher": "0xfebd01993009d3d19049b7186dabd4b49eba15c8", - "supply": "9.078947368421053", - "symbol": "JUILOB-15", - "tx": "0x23dbf414b653f67db437bee0f5f4e8a491bea297b5763d2b9b3ddb454c381df5" - }, - { - "address": "0x00d75f1dadaf1cfd77c1c16180b14fcf0c22d859", - "cap": "1000", - "createTime": 1606135635, - "holderCount": "0", - "id": "0x00d75f1dadaf1cfd77c1c16180b14fcf0c22d859", - "metadataUpdateCount": "1", - "name": "Defamatory Fish Token", - "orderCount": "1", - "orderVolume": "1", - "publisher": "0xa5532218769800392408144ab3cafcbea0fd563d", - "supply": "1000", - "symbol": "DEFFIS-59", - "tx": "0x63e4ae50052c35c18612f3b90a6c02c7a5f184281bbbb5bd80c9d37de0b04af2" - }, - { - "address": "0x0113b54135e2be4c919ab6fd3c28ead798f7e83f", - "cap": "1000", - "createTime": 1603921926, - "holderCount": "0", - "id": "0x0113b54135e2be4c919ab6fd3c28ead798f7e83f", - "metadataUpdateCount": "0", - "name": "Jocular Otter Token", - "orderCount": "0", - "orderVolume": "0", - "publisher": "0x13496a822830d5e8087d6b216af8919dd03a5ceb", - "supply": "0", - "symbol": "JOCOTT-98", - "tx": "0x1bbe4ce8ac0eb6e9db6cba5a406c03e94f9244bd226ba65f87ea34b50dd0186f" - }, - { - "address": "0x018dc6c33e66381cd29ce13c176d9414cfa5cd05", - "cap": "1000", - "createTime": 1604303120, - "holderCount": "0", - "id": "0x018dc6c33e66381cd29ce13c176d9414cfa5cd05", - "metadataUpdateCount": "0", - "name": "Ubiquitous Mackerel Token", - "orderCount": "0", - "orderVolume": "0", - "publisher": "0xde828bfa26f82f9394d7f3a315133933ef523ae1", - "supply": "0", - "symbol": "UBIMAC-9", - "tx": "0x46e853b4938d7a554f29b6f00e7458021dee2f0ac19085d1d207def8ad407896" - } - ] - } -} - -``` - -
- diff --git a/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md b/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md index ebd11a2e2..dd3f78865 100644 --- a/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md +++ b/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md @@ -1,5 +1,45 @@ # List Fixed Rate Exchanges +The result of following GraphQL query returns the information about the Fixed Rate Exchanges. + +```graphql +{ + fixedRateExchanges(skip:0, first:2, subgraphError:deny){ + id + contract + exchangeId + owner{id} + datatoken{ + id + name + symbol + } + price + datatokenBalance + active + totalSwapValue + swaps(skip:0, first:1){ + tx + by { + id + } + baseTokenAmount + dataTokenAmount + createdTimestamp + } + updates(skip:0, first:1){ + oldPrice + newPrice + newActive + createdTimestamp + tx + } + } +} +``` + +The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. + {% tabs %} {% tab title="Python" %} #### Create script @@ -12,27 +52,41 @@ import json query = """ { - fixedRateExchanges{ - rate - active - baseToken - datatoken {address} - exchangeOwner { + fixedRateExchanges(skip:0, first:2, subgraphError:deny){ + id + contract + exchangeId + owner{id} + datatoken{ id + name + symbol } - swaps(skip:0, first: 2) { - by {id} + price + datatokenBalance + active + totalSwapValue + swaps(skip:0, first:1){ tx - block - dataTokenAmount + by { + id + } baseTokenAmount + dataTokenAmount + createdTimestamp + } + updates(skip:0, first:1){ + oldPrice + newPrice + newActive + createdTimestamp + tx } } }""" -print(query) -base_url = "https://subgraph.mainnet.oceanprotocol.com" +base_url = "https://v4.subgraph.mainnet.oceanprotocol.com" route = "/subgraphs/name/oceanprotocol/ocean-subgraph" url = base_url + route @@ -41,8 +95,8 @@ headers = {"Content-Type": "application/json"} payload = json.dumps({"query": query}) response = requests.request("POST", url, headers=headers, data=payload) result = json.loads(response.text) -print(result) +print(json.dumps(result, indent=4, sort_keys=True)) ``` {% endcode %} @@ -60,36 +114,59 @@ python list_fixed_rate_exchanges.py ```json { - "data": { - "fixedRateExchanges": [ - { - "active": true, - "baseToken": "0x967da4048cd07ab37855c090aaf366e4ce1b9f48", - "datatoken": { - "address": "0xd3409d159ac9cd9c067b64f7d1bb625febf9abc2" - }, - "exchangeOwner": { - "id": "0x1d2145d078f4957b2d6f1d09cfc68fe5aa839bc7" - }, - "rate": "55", - "swaps": [] + "data": { + "fixedRateExchanges": [ + { + "active": true, + "contract": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02", + "datatoken": { + "id": "0x9b39a17cc72c8be4813d890172eff746470994ac", + "name": "Delightful Pelican Token", + "symbol": "DELPEL-79" + }, + "datatokenBalance": "0", + "exchangeId": "0x06284c39b48afe5f01a04d56f1aae45dbb29793b190ee11e93a4a77215383d44", + "id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x06284c39b48afe5f01a04d56f1aae45dbb29793b190ee11e93a4a77215383d44", + "owner": { + "id": "0x03ef3f422d429bcbd4ee5f77da2917a699f237ed" + }, + "price": "33", + "swaps": [ + { + "baseTokenAmount": "33.033", + "by": { + "id": "0x9b39a17cc72c8be4813d890172eff746470994ac" }, - { - "active": true, - "baseToken": "0x967da4048cd07ab37855c090aaf366e4ce1b9f48", - "datatoken": { - "address": "0xca68c5e7a565ade806b081ad2326a54c390b522f" - }, - "exchangeOwner": { - "id": "0xad23fc9d943018c34ac55e8da29af700a2fd0feb" - }, - "rate": "1", - "swaps": [] - } - ] - } + "createdTimestamp": 1656563684, + "dataTokenAmount": "1", + "tx": "0x0b55482f69169c103563062e109f9d71afa01d18f201c425b24b1c74d3c282a3" + } + ], + "totalSwapValue": "0", + "updates": [] + }, + { + "active": true, + "contract": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02", + "datatoken": { + "id": "0x2cf074e36a802241f2f8ddb35f4a4557b8f1179b", + "name": "Arcadian Eel Token", + "symbol": "ARCEEL-17" + }, + "datatokenBalance": "0", + "exchangeId": "0x2719862ebc4ed253f09088c878e00ef8ee2a792e1c5c765fac35dc18d7ef4deb", + "id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x2719862ebc4ed253f09088c878e00ef8ee2a792e1c5c765fac35dc18d7ef4deb", + "owner": { + "id": "0x87b5606fba13529e1812319d25c6c2cd5c3f3cbc" + }, + "price": "35", + "swaps": [], + "totalSwapValue": "0", + "updates": [] + } + ] + } } -json ```
diff --git a/building-with-ocean/using-ocean-subgraph/list-nfts.md b/building-with-ocean/using-ocean-subgraph/list-nfts.md new file mode 100644 index 000000000..702fc695f --- /dev/null +++ b/building-with-ocean/using-ocean-subgraph/list-nfts.md @@ -0,0 +1,195 @@ +# List NFTs + + + +The result of following GraphQL query returns the information about nfts. Additional fields can also + +```graphql +{ + nfts (skip:0, first: 10, subgraphError:deny){ + id + name + symbol + owner + address + assetState + tx + block + transferable + } +} +``` + +The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. + +{% tabs %} +{% tab title="Python" %} +{% code title="list_nfts.py" %} +```python +import requests +import json + + +query = """ +{ + nfts (skip:0, first: 10, subgraphError:deny){ + id + name + symbol + owner + address + assetState + tx + block + transferable + } +}""" + + +base_url = "https://v4.subgraph.mainnet.oceanprotocol.com" +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) + +print(json.dumps(result, indent=4, sort_keys=True)) + +``` +{% endcode %} + +#### Execute script + +``` +python list_nfts.py +``` +{% endtab %} +{% endtabs %} + +
+ +Sample response + +```json +{ + "data": { + "nfts": [ + { + "address": "0x1c161d721e6d99f58d47f709cdc77025056c544c", + "assetState": 0, + "block": 15185270, + "id": "0x1c161d721e6d99f58d47f709cdc77025056c544c", + "name": "Ocean Data NFT", + "owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0x327a9da0d2e9df945fd2f8e10b1caa77acf98e803c5a2f588597172a0bcbb93a" + }, + { + "address": "0x1e06501660623aa973474e3c59efb8ba542cb083", + "assetState": 0, + "block": 15185119, + "id": "0x1e06501660623aa973474e3c59efb8ba542cb083", + "name": "Ocean Data NFT", + "owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0xd351ccee22b505d811c29fa524db920815936672b20b8f3a09485e389902fd27" + }, + { + "address": "0x2eaa55236f799c6ebec72e77a1a6296ea2e704b1", + "assetState": 0, + "block": 15185009, + "id": "0x2eaa55236f799c6ebec72e77a1a6296ea2e704b1", + "name": "Ocean Data NFT", + "owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0xf6d55306ab4dc339dc1655a2d119af468a79a70fa62ea11de78879da61e89e7b" + }, + { + "address": "0x2fbe924f6c92825929dc7785fe05d15e35f2612b", + "assetState": 0, + "block": 15185235, + "id": "0x2fbe924f6c92825929dc7785fe05d15e35f2612b", + "name": "Ocean Data NFT", + "owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0xa9ff9d461b4b7344ea181de32fa6412c7ea8e21f485ab4d8a7b9cfcdb68d9d51" + }, + { + "address": "0x4c04433bb1760a66be7713884bb6370e9c567cef", + "assetState": 0, + "block": 15185169, + "id": "0x4c04433bb1760a66be7713884bb6370e9c567cef", + "name": "Ocean Data NFT", + "owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0x54c5463e8988b5fa4e4cfe71ee391505801931abe9e94bf1588dd538ec3aa4c9" + }, + { + "address": "0x619c500dcb0251b31cd480030db2dcc19866c0c3", + "assetState": 0, + "block": 15236619, + "id": "0x619c500dcb0251b31cd480030db2dcc19866c0c3", + "name": "abc", + "owner": "0x12fe650c86cd4346933ef1bcab21a1979d4c6786", + "symbol": "GOAL-9956", + "transferable": true, + "tx": "0x6178b03589cda98573ff52a1afbcc07b14a2fddacc0132595949e9d8a0ed1b32" + }, + { + "address": "0x6d45a5b38a122a6dbc042601236d6ecc5c8e343e", + "assetState": 0, + "block": 15109853, + "id": "0x6d45a5b38a122a6dbc042601236d6ecc5c8e343e", + "name": "Ocean Data NFT", + "owner": "0xbbd33afa85539fa65cc08a2e61a001876d2f13fe", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0x27aa77a0bf3f7878910dc7bfe2116d9271138c222b3d898381a5c72eefefe624" + }, + { + "address": "0x7400078c5d4fd7704afca45a928d9fc97cbea744", + "assetState": 0, + "block": 15185056, + "id": "0x7400078c5d4fd7704afca45a928d9fc97cbea744", + "name": "Ocean Data NFT", + "owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0x2025374cd347e25e2651feec2f2faa2feb26664698eaea42b5dad1a31eda57f8" + }, + { + "address": "0x81decdb59dce5b4323e683a76f8fa8dd0eabc560", + "assetState": 0, + "block": 15185003, + "id": "0x81decdb59dce5b4323e683a76f8fa8dd0eabc560", + "name": "Ocean Data NFT", + "owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0x6ad6ec2ce86bb70e077590a64c886d72975374bd2e993f143d9da8edcaace82b" + }, + { + "address": "0x8684119ecf77c5be41f01760ad466725ffd9b960", + "assetState": 0, + "block": 14933034, + "id": "0x8684119ecf77c5be41f01760ad466725ffd9b960", + "name": "Ocean Data NFT", + "owner": "0x87b5606fba13529e1812319d25c6c2cd5c3f3cbc", + "symbol": "OCEAN-NFT", + "transferable": true, + "tx": "0x55ba746cd8e8fb4c739b8544a9034848082b627500b854cb8db0802dd7beb172" + } + ] + } +} +``` + +
diff --git a/core-concepts/did-ddo.md b/core-concepts/did-ddo.md index 394904141..8d50741f1 100644 --- a/core-concepts/did-ddo.md +++ b/core-concepts/did-ddo.md @@ -309,6 +309,8 @@ An asset with a service of `type` `compute` has the following additional attribu | `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. | | Type | Required | Description | | `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. | +| Type | Required | Description | +| `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

TypeRequiredDescription
booleanIf true, the algorithm job will have network access.
| | | | Type | Required | Description | | `boolean` | **✓** | If `true`, the algorithm job will have network access. | @@ -318,6 +320,8 @@ An asset with a service of `type` `compute` has the following additional attribu | `boolean` | **✓** | If `true`, the algorithm job will have network access. | | Type | Required | Description | | `boolean` | **✓** | If `true`, the algorithm job will have network access. | +| Type | Required | Description | +| `boolean` | **✓** | If `true`, the algorithm job will have network access. | |

publisherTrustedAlgorithmPublishers

TypeRequiredDescription
Array of stringIf 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.
| | | | Type | Required | Description | | 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. | @@ -327,6 +331,8 @@ An asset with a service of `type` `compute` has the following additional attribu | 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. | | Type | Required | Description | | 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. | +| Type | Required | Description | +| 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

TypeRequiredDescription
Array of publisherTrustedAlgorithmsIf 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).
| | | | Type | Required | Description | | 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). | @@ -336,6 +342,8 @@ An asset with a service of `type` `compute` has the following additional attribu | 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). | | Type | Required | Description | | 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). | +| Type | Required | Description | +| 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). | The `publisherTrustedAlgorithms` is an array of objects with the following structure: diff --git a/orientation/faq.md b/orientation/faq.md index 23b09069c..cd6d2282c 100644 --- a/orientation/faq.md +++ b/orientation/faq.md @@ -1,12 +1,12 @@ --- title: FAQs -description: Frequently Asked Questions about Ocean Protocol order: 5 hideLanguageSelector: true featuredImage: images/creatures/mantaray/mantaray-full@2x.png +description: Frequently Asked Questions about Ocean Protocol --- -# ❓ Frequently Asked Questions +# FAQ Have some questions about Ocean Protocol? @@ -15,14 +15,16 @@ Hopefully you'll find the answers here! If not then please don't hesitate to rea ### General Questions
- What is a decentralized data marketplace? + +What is a decentralized data marketplace? A data marketplace allows providers to publish data and buyers to consume data. Unlike centralized data marketplaces, decentralized ones give users more control over their data, algorithms and analytics by minimizing custodianship and providing transparent and immutable records of every transaction. With features such as Compute-to-Data (C2D), data and algorithms can be ingested into secure Docker containers where escapes avoided, protecting both the data and algorithms.
- What is needed to use a decentralized marketplace? + +What is needed to use a decentralized marketplace? Users access decentralized marketplaces via Metamask. Metamask is an applet interface that manages unique IDs, generated and controlled fully by the user. These unique IDs (aka Ethereum address) are used to store digital assets such as cryptocurrency, datatokens, NFTs and other web3 native assets. @@ -33,49 +35,56 @@ Once a user has Metamask installed and an Ethereum address, they can register, c
- How is Ocean different from other data marketplaces? + +How is Ocean different from other data marketplaces? Ocean Protocol is a decentralized data marketplace which gives users complete control of their data. The Ocean Protocol technology is built on smart contracts, decentralized computer scripts with no intermediary that are triggered by the users. The Ocean Market exposes the functionality of the smart contracts in a browser-friendly interface. Data providers and consumers can discover one another and transact in a peer-to-peer manner with the minimal amount of intermediary involvement.
- How do I price my data? + +How do I price my data? Ocean gives you two different options for pricing your data - fixed price or free. You need to decide what your dataset is worth and how you want to price it. You can change the price but you can’t change the price format (e.g. from fixed to free).
- Is my data secure? + +Is my data secure? Yes. Ocean Protocol understands that some data is too sensitive to be shared — potentially due to GDPR or other reasons. For these types of datasets, we offer a unique service called compute-to-data. This enables you to monetise the dataset that sits behind a firewall without ever revealing the raw data to the consumer. For example, researchers and data scientists pay to run their algorithms on the data set and the computation is performed behind a firewall; all the researchers or data scientists receive is the results generated by their algorithm.
- Where is my data stored? + +Where is my data stored? Ocean does not provide data storage. Users have the choice to store their data on their own servers, cloud or decentralized storage. Users need only to provide a URL to the dataset, which is then encrypted as a means to protect the access to the dataset.
- How do I control who accesses my data? + +How do I control who accesses my data? Ocean provides tools for access control, fine grained permissions, passlisting and blocklisting addresses. Data and AI services can be shared under the conditions set by the owner of data. There is no central intermediary, which ensures no one can interfere with the transaction and both the publisher and user have transparency.
- Can I restrict who is able to access my dataset? + +Can I restrict who is able to access my dataset? Yes - Ocean has implemented fine grained permissions. This means that you can create allow and deny lists that restrict access from certain individuals or limit access to particular organizations.
- What is the reach of Ocean Market - how many data buyers can I sell to? + +What is the reach of Ocean Market - how many data buyers can I sell to? Hundreds of unique datasets are available that are sourced from private individuals, research institutions, commercial enterprises and government. Publishing data on Ocean offers data providers and algorithm owners an exciting new channel to connect with a rapidly growing community of Web3 enthusiasts and data science professionals around the world. @@ -84,35 +93,40 @@ Hundreds of unique datasets are available that are sourced from private individu ### Technical Questions
- Why does Ocean Protocol use the Blockchain? + +Why does Ocean Protocol use the Blockchain? For both providers and consumers of data, blockchain is a superior substrate for building applications.Blockchain allows business logic to be instantiated in a network and triggered by the users, without intermediaries. This innovation promises lower transaction costs, higher security, more control, less errors and more transparency & auditability.
- The blockchain is public - does this mean that anyone can access my data? + +The blockchain is public - does this mean that anyone can access my data? No one is able to access data via the blockchain without purchasing access (with the datatoken) though the smart contract. Ocean smart contracts encrypt the URL to the dataset before it is published on the blockchain. This means that only the encrypted URL will be queryable in the public blockchain. Ocean technology facilitates data access to the consumer via a proxy (Ocean Provider) and the unencrypted url is never exposed.
- What is a smart contract and why is it relevant? + +What is a smart contract and why is it relevant? The blockchain can do more than just store information - it can also run code. A smart contract is an executable script that runs on the blockchain, with no intermediary and is fully transparent and auditable by anyone. In Ocean, smart contracts facilitate access to data and AI if the access conditions set out by the publisher are fulfilled.
- What is a datatoken? + +What is a datatoken? A datatoken is an access token to datasets and services published in the Ocean ecosystem. Datatokens can be purchased via the Ocean Market or on a decentralized crypto exchange. . If a consumer wishes to access a dataset, they must acquire the datatoken and then exchange the datatoken for access to the dataset.
- How do I acquire datatokens? + +How do I acquire datatokens? Datatokens can be acquired and traded in Ocean Market. There are several ways to acquire data tokens. Data publishers can acquire datatokens by publishing datasets and then receiving the generated datatokens. @@ -125,70 +139,80 @@ Datatokens can also be sent from anyone who holds a datatoken for a particular a ### Data Selling Questions
- How are organizations leveraging data sharing? + +How are organizations leveraging data sharing? For the most part organizations are leveraging data sharing to benefit from data monetization, however increasingly organizations are also sharing data in order to boost their progress on sustainability goals. For example, data aggregated from vehicles can not only bring new revenue streams to automotive firms but can also be used to battle pollution.
- Does it pay to become a marketplace operator? + +Does it pay to become a marketplace operator? Yes. Marketplace operators benefit from earning commission on marketplace transactions related to data consumption. Ocean Market is primarily focussed on monetising data however it is also designed to handle the sale of any digital asset or service. As a result the total addressable market goes way beyond revenues from just selling data. Operating costs for an Ocean-powered marketplace are moderate and the base code is open source and available free of charge under the Apache 2 license.
- Why Publish? + +Why Publish? Publishing data, algorithms and other digital assets and services on an Ocean-powered marketplace offers numerous opportunities to earn on the future revenue streams connected to that data as well as build lucrative ecosystem that add value to the published asset. It also allows for the discovery and insights into new use cases and applications of the published asset.
- What about the price fluctuation of Ocean? + +What about the price fluctuation of Ocean? Price fluctuation is mitigated through the use of the Ocean backed stable coin H2O.
- Who pays for gas fees? + +Who pays for gas fees? Gas fees for marketplace transactions are paid by the user initiating the transaction (for publishing, consuming, etc).
- Where do the docker containers run? + +Where do the docker containers run? Dockers containers can run anywhere. Ocean Market use a docker run by the Ocean Protocol Foundation OPF); limit: 1 CPU limit / 60 seconds max. NOTE: This means OPF technically has access to data. In the case of a forked Ocean-powered marketplace the owner of marketplace must set up computation environment. If individual users of the marketplace are concerned with security they should be prepared to host both the data and provide compute-to-data services on premise.
- Who pays for the computation? + +Who pays for the computation? The marketplace owner.
- What cryptocurrency do I need for transactions? + +What cryptocurrency do I need for transactions? The type if cryptocurrencies needed for transactions on the marketplace depends on which network(s) the marketplace is running (Ethereum, Polygon, EWT, BSC, Moonriver, etc.). Regardless of network, users will need to have Ocean tokens as well as the corresponding network token, which is used to pay for gas.
- Can I use the off the shelf CSS available in the repo? + +Can I use the off the shelf CSS available in the repo? Marketplace name, logo and typeface must be changed by the client. Slight modification would be enough for compliance. For more information consult the READ ME file on GitHub. https://github.com/oceanprotocol/market#-forking
- What’s to come with Ocean this year? + +What’s to come with Ocean this year? Checkout our [roadmap](https://oceanprotocol.com/technology/roadmap) to see what's we are currently working on. If you are interested in tracking our progress towards these goals then take a look at our [github](https://github.com/oceanprotocol/). From 1e293f9d31012270219eaca14da6fe1975390ce7 Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 31 Jul 2022 21:50:21 +0000 Subject: [PATCH 7/8] GitBook: [#7] Subgraph examples --- SUMMARY.md | 4 ++-- .../{list-nfts.md => list-data-nfts.md} | 11 ++++------- .../{list-all-tokens.md => list-datatokens.md} | 0 3 files changed, 6 insertions(+), 9 deletions(-) rename building-with-ocean/using-ocean-subgraph/{list-nfts.md => list-data-nfts.md} (98%) rename building-with-ocean/using-ocean-subgraph/{list-all-tokens.md => list-datatokens.md} (100%) diff --git a/SUMMARY.md b/SUMMARY.md index ae4e9da76..7b3aa7a05 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -36,8 +36,8 @@ * [Deploying Provider](building-with-ocean/deploying-components/deploying-provider.md) * [Deploying Ocean subgraph](building-with-ocean/deploying-components/deploying-ocean-subgraph.md) * [Using Ocean Subgraph](building-with-ocean/using-ocean-subgraph/README.md) - * [List NFTs](building-with-ocean/using-ocean-subgraph/list-nfts.md) - * [List all tokens](building-with-ocean/using-ocean-subgraph/list-all-tokens.md) + * [List data NFTs](building-with-ocean/using-ocean-subgraph/list-data-nfts.md) + * [List all tokens](building-with-ocean/using-ocean-subgraph/list-datatokens.md) * [Get data NFT information](building-with-ocean/using-ocean-subgraph/get-data-nft-information.md) * [Get datatoken information](building-with-ocean/using-ocean-subgraph/get-datatoken-information.md) * [List Fixed Rate Exchanges](building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md) diff --git a/building-with-ocean/using-ocean-subgraph/list-nfts.md b/building-with-ocean/using-ocean-subgraph/list-data-nfts.md similarity index 98% rename from building-with-ocean/using-ocean-subgraph/list-nfts.md rename to building-with-ocean/using-ocean-subgraph/list-data-nfts.md index 702fc695f..428afd7df 100644 --- a/building-with-ocean/using-ocean-subgraph/list-nfts.md +++ b/building-with-ocean/using-ocean-subgraph/list-data-nfts.md @@ -1,8 +1,6 @@ -# List NFTs +# List data NFTs - - -The result of following GraphQL query returns the information about nfts. Additional fields can also +The result of following GraphQL query returns the information about data nfts. ```graphql { @@ -24,7 +22,7 @@ The python script below can be used to run the the query. If you wish to change {% tabs %} {% tab title="Python" %} -{% code title="list_nfts.py" %} +{% code title="list_dataNFTs.py" %} ```python import requests import json @@ -57,14 +55,13 @@ response = requests.request("POST", url, headers=headers, data=payload) result = json.loads(response.text) print(json.dumps(result, indent=4, sort_keys=True)) - ``` {% endcode %} #### Execute script ``` -python list_nfts.py +python list_dataNFTs.py ``` {% endtab %} {% endtabs %} diff --git a/building-with-ocean/using-ocean-subgraph/list-all-tokens.md b/building-with-ocean/using-ocean-subgraph/list-datatokens.md similarity index 100% rename from building-with-ocean/using-ocean-subgraph/list-all-tokens.md rename to building-with-ocean/using-ocean-subgraph/list-datatokens.md From b59abebfcdda9f0c601a30c7956ef461fabaa374 Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Mon, 1 Aug 2022 13:27:07 +0000 Subject: [PATCH 8/8] GitBook: [#8] Add hint for GraphQL interface --- .../using-ocean-subgraph/get-data-nft-information.md | 6 +++++- .../using-ocean-subgraph/get-datatoken-information.md | 6 +++++- building-with-ocean/using-ocean-subgraph/list-data-nfts.md | 6 +++++- building-with-ocean/using-ocean-subgraph/list-datatokens.md | 6 +++++- .../using-ocean-subgraph/list-fixed-rate-exchanges.md | 6 +++++- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/building-with-ocean/using-ocean-subgraph/get-data-nft-information.md b/building-with-ocean/using-ocean-subgraph/get-data-nft-information.md index 9938fd928..f1f1ff2c0 100644 --- a/building-with-ocean/using-ocean-subgraph/get-data-nft-information.md +++ b/building-with-ocean/using-ocean-subgraph/get-data-nft-information.md @@ -1,6 +1,10 @@ # Get data NFT information -The result of following GraphQL query returns the information about a particular datatoken. Here, 0x1c161d721e6d99f58d47f709cdc77025056c544c is the address of the dataNFT. +The result of following GraphQL query returns the information about a particular datatoken. Here, `0x1c161d721e6d99f58d47f709cdc77025056c544c` is the address of the dataNFT. + +{% hint style="info" %} +Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md). +{% endhint %} ```graphql { diff --git a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md index 891200d16..9e8262e2b 100644 --- a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md +++ b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md @@ -2,7 +2,11 @@ -The result of following GraphQL query returns the information about a particular datatoken. Here, `0x122d10d543bc600967b4db0f45f80cb1ddee43eb` is the address of the datatoken. +The result of following GraphQL query returns the information about a particular datatoken. Here, `0x122d10d543bc600967b4db0f45f80cb1ddee43eb` is the address of the datatoken. + +{% hint style="info" %} +Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md). +{% endhint %} ```graphql { diff --git a/building-with-ocean/using-ocean-subgraph/list-data-nfts.md b/building-with-ocean/using-ocean-subgraph/list-data-nfts.md index 428afd7df..152b2029e 100644 --- a/building-with-ocean/using-ocean-subgraph/list-data-nfts.md +++ b/building-with-ocean/using-ocean-subgraph/list-data-nfts.md @@ -1,6 +1,10 @@ # List data NFTs -The result of following GraphQL query returns the information about data nfts. +The result of following GraphQL query returns the information about data nfts. + +{% hint style="info" %} +Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md). +{% endhint %} ```graphql { diff --git a/building-with-ocean/using-ocean-subgraph/list-datatokens.md b/building-with-ocean/using-ocean-subgraph/list-datatokens.md index 4aaeb5013..7ab4ee619 100644 --- a/building-with-ocean/using-ocean-subgraph/list-datatokens.md +++ b/building-with-ocean/using-ocean-subgraph/list-datatokens.md @@ -1,6 +1,10 @@ # List all tokens -The result of following GraphQL query returns the information about datatokens. +The result of following GraphQL query returns the information about datatokens. + +{% hint style="info" %} +Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md). +{% endhint %} ```graphql { diff --git a/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md b/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md index dd3f78865..c42cd8a72 100644 --- a/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md +++ b/building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md @@ -1,6 +1,10 @@ # List Fixed Rate Exchanges -The result of following GraphQL query returns the information about the Fixed Rate Exchanges. +The result of following GraphQL query returns the information about the Fixed Rate Exchanges. + +{% hint style="info" %} +Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md). +{% endhint %} ```graphql {