mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
This commit is contained in:
parent
c6878db09a
commit
549c292abb
@ -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
|
# 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) |
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# Get Data NFT Information
|
# 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" %}
|
{% 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 %}
|
{% endhint %}
|
||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
@ -83,7 +83,7 @@ print(json.dumps(result, indent=4, sort_keys=True))
|
|||||||
```
|
```
|
||||||
{% endcode %}
|
{% endcode %}
|
||||||
|
|
||||||
#### Execute script
|
**Execute script**
|
||||||
|
|
||||||
```
|
```
|
||||||
python dataNFT_information.py
|
python dataNFT_information.py
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
|
||||||
# Get Datatoken Information
|
# Get Datatoken Information
|
||||||
|
|
||||||
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" %}
|
{% 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 %}
|
{% endhint %}
|
||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
@ -48,7 +49,7 @@ The python script below can be used to run the the query. If you wish to change
|
|||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{% tab title="Python" %}
|
{% tab title="Python" %}
|
||||||
#### Create script
|
**Create script**
|
||||||
|
|
||||||
{% code title="datatoken_information.py" %}
|
{% code title="datatoken_information.py" %}
|
||||||
```python
|
```python
|
||||||
@ -106,11 +107,10 @@ response = requests.request("POST", url, headers=headers, data=payload)
|
|||||||
result = json.loads(response.text)
|
result = json.loads(response.text)
|
||||||
|
|
||||||
print(json.dumps(result, indent=4, sort_keys=True))
|
print(json.dumps(result, indent=4, sort_keys=True))
|
||||||
|
|
||||||
```
|
```
|
||||||
{% endcode %}
|
{% endcode %}
|
||||||
|
|
||||||
#### Execute script
|
**Execute script**
|
||||||
|
|
||||||
```
|
```
|
||||||
python datatoken_information.py
|
python datatoken_information.py
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# List data NFTs
|
# 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" %}
|
{% 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 %}
|
{% endhint %}
|
||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
@ -62,7 +62,7 @@ print(json.dumps(result, indent=4, sort_keys=True))
|
|||||||
```
|
```
|
||||||
{% endcode %}
|
{% endcode %}
|
||||||
|
|
||||||
#### Execute script
|
**Execute script**
|
||||||
|
|
||||||
```
|
```
|
||||||
python list_dataNFTs.py
|
python list_dataNFTs.py
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# List all Tokens
|
# 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" %}
|
{% 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 %}
|
{% endhint %}
|
||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
@ -43,7 +43,7 @@ The python script below can be used to run the the query. If you wish to change
|
|||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{% tab title="Python" %}
|
{% tab title="Python" %}
|
||||||
#### Create script
|
**Create script**
|
||||||
|
|
||||||
{% code title="list_all_tokens.py" %}
|
{% code title="list_all_tokens.py" %}
|
||||||
```python
|
```python
|
||||||
@ -95,11 +95,10 @@ response = requests.request("POST", url, headers=headers, data=payload)
|
|||||||
result = json.loads(response.text)
|
result = json.loads(response.text)
|
||||||
|
|
||||||
print(json.dumps(result, indent=4, sort_keys=True))
|
print(json.dumps(result, indent=4, sort_keys=True))
|
||||||
|
|
||||||
```
|
```
|
||||||
{% endcode %}
|
{% endcode %}
|
||||||
|
|
||||||
#### Execute script
|
**Execute script**
|
||||||
|
|
||||||
```
|
```
|
||||||
python list_all_tokens.py
|
python list_all_tokens.py
|
||||||
@ -147,4 +146,3 @@ python list_all_tokens.py
|
|||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# List Fixed Rate Exchanges
|
# 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" %}
|
{% 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 %}
|
{% endhint %}
|
||||||
|
|
||||||
```graphql
|
```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 %}
|
{% tabs %}
|
||||||
{% tab title="Python" %}
|
{% tab title="Python" %}
|
||||||
#### Create script
|
**Create script**
|
||||||
|
|
||||||
{% code title="list_fixed_rate_exchanges.py" %}
|
{% code title="list_fixed_rate_exchanges.py" %}
|
||||||
```python
|
```python
|
||||||
@ -104,7 +104,7 @@ print(json.dumps(result, indent=4, sort_keys=True))
|
|||||||
```
|
```
|
||||||
{% endcode %}
|
{% endcode %}
|
||||||
|
|
||||||
#### Execute script
|
**Execute script**
|
||||||
|
|
||||||
```
|
```
|
||||||
python list_fixed_rate_exchanges.py
|
python list_fixed_rate_exchanges.py
|
||||||
|
Loading…
Reference in New Issue
Block a user