diff --git a/building-with-ocean/using-ocean-subgraph/README.md b/building-with-ocean/using-ocean-subgraph/README.md index 10409898..80541fb4 100644 --- a/building-with-ocean/using-ocean-subgraph/README.md +++ b/building-with-ocean/using-ocean-subgraph/README.md @@ -1,10 +1,23 @@ ---- -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 -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). +Ocean subgraph is an off-chain service that provides information about datatokens, users, and balances using GraphQL. The Ocean subgraph provides a faster way to fetch data rather than an on-chain query. The data from Ocean subgraph can be queried using [GraphQL](https://graphql.org/learn/). + +You can use the Subgraph instances hosted by Ocean Protocol or host your instance. The page on Deploying Ocean Subgraph provides a guide on hosting your own Ocean Subgraph instance. + +For each supported network, an individual Ocean subgraph is deployed. The information about supported networks are available on this [page](../../core-concepts/networks.md). + +#### Ocean Subgraph GraphiQL + +The below table provides the link to GraphiQL for the support networks. The Graphql queries can be directly executed using the GraphiQL interface without the need of any setup. + +| Network and link | +| ----------------------------------------------------------------------------------------------------------------------- | +| [Ethereum Mainnet](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | +| [Polygon Mainnet](https://v4.subgraph.polygon.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | +| [Binance Smart Chain](https://v4.subgraph.bsc.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | +| [Energy Web Chain](https://v4.subgraph.energyweb.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | +| [Moonriver](https://v4.subgraph.moonriver.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | +| [Mumbai](https://v4.subgraph.mumbai.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | +| [Rinkeby](https://v4.subgraph.rinkeby.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | +| [Ropsten](https://v4.subgraph.ropsten.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | +| [Moonbase](https://v4.subgraph.moonbase.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) | 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 74f9487d..9f8e093f 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,9 +1,9 @@ # 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). +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 use [this table](./#ocean-subgraph-graphiql). {% endhint %} ```graphql @@ -83,7 +83,7 @@ print(json.dumps(result, indent=4, sort_keys=True)) ``` {% endcode %} -#### Execute script +**Execute script** ``` python dataNFT_information.py 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 6eecdcc3..e18ef0cc 100644 --- a/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md +++ b/building-with-ocean/using-ocean-subgraph/get-datatoken-information.md @@ -1,9 +1,10 @@ + # Get Datatoken Information 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). +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 use [this table](./#ocean-subgraph-graphiql). {% endhint %} ```graphql @@ -48,7 +49,7 @@ The python script below can be used to run the the query. If you wish to change {% tabs %} {% tab title="Python" %} -#### Create script +**Create script** {% code title="datatoken_information.py" %} ```python @@ -106,11 +107,10 @@ 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 +**Execute script** ``` python datatoken_information.py 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 152b2029..0fc994a9 100644 --- a/building-with-ocean/using-ocean-subgraph/list-data-nfts.md +++ b/building-with-ocean/using-ocean-subgraph/list-data-nfts.md @@ -1,9 +1,9 @@ # 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). +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 use [this table](./#ocean-subgraph-graphiql). {% endhint %} ```graphql @@ -62,7 +62,7 @@ print(json.dumps(result, indent=4, sort_keys=True)) ``` {% endcode %} -#### Execute script +**Execute script** ``` python list_dataNFTs.py diff --git a/building-with-ocean/using-ocean-subgraph/list-datatokens.md b/building-with-ocean/using-ocean-subgraph/list-datatokens.md index f19eb8c0..d268b70d 100644 --- a/building-with-ocean/using-ocean-subgraph/list-datatokens.md +++ b/building-with-ocean/using-ocean-subgraph/list-datatokens.md @@ -1,9 +1,9 @@ # 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). +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 use [this table](./#ocean-subgraph-graphiql). {% endhint %} ```graphql @@ -43,7 +43,7 @@ The python script below can be used to run the the query. If you wish to change {% tabs %} {% tab title="Python" %} -#### Create script +**Create script** {% code title="list_all_tokens.py" %} ```python @@ -95,11 +95,10 @@ 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 +**Execute script** ``` python list_all_tokens.py @@ -147,4 +146,3 @@ python list_all_tokens.py ``` - 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 c42cd8a7..708df1a2 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,9 +1,9 @@ # 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). +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 use [this table](./#ocean-subgraph-graphiql). {% endhint %} ```graphql @@ -42,11 +42,11 @@ Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprot } ``` -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. +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 +**Create script** {% code title="list_fixed_rate_exchanges.py" %} ```python @@ -104,7 +104,7 @@ print(json.dumps(result, indent=4, sort_keys=True)) ``` {% endcode %} -#### Execute script +**Execute script** ``` python list_fixed_rate_exchanges.py