1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

GITBOOK-1: change request with no subject merged in GitBook

This commit is contained in:
Ana Loznianu 2023-04-10 14:03:48 +00:00 committed by gitbook-bot
parent e77d997e64
commit 5ce405f16d
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
24 changed files with 148 additions and 1363 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

View File

@ -2,7 +2,7 @@
description: Ocean Protocol - Tools for the Web3 Data Economy
---
# Ocean Documentation
# 🌊 Discover
## What is Ocean?
@ -10,14 +10,14 @@ Ocean provides the next generation of tools to unlock data at a large scale. Oce
Ocean uses Data NFTs (ERC721) and datatokens (ERC20) as the interface to connect data assets with blockchain and DeFi tools. Crypto wallets become data wallets, crypto exchanges become data marketplaces, DAOs for data co-ops, and more via DeFi composability.
![Creating a New Data Economy](./.gitbook/assets/architecture/feature-datascience@2x.webp)
![Creating a New Data Economy](.gitbook/assets/architecture/feature-datascience@2x.webp)
The following guides are a greate place to start if you are new to Ocean:
- [Architecture Overview](core-concepts/architecture.md)
- [Data NFTs and Datatokens](core-concepts/datanft-and-datatoken.md)
- [Publish a data asset](using-ocean-market/marketplace-publish-data-asset.md)
- [Download a data asset](using-ocean-market/marketplace-download-data-asset.md)
* [Architecture Overview](core-concepts/architecture.md)
* [Data NFTs and Datatokens](core-concepts/datanft-and-datatoken.md)
* [Publish a data asset](using-ocean-market/marketplace-publish-data-asset.md)
* [Download a data asset](using-ocean-market/marketplace-download-data-asset.md)
## What is our Mission?
@ -37,25 +37,25 @@ Use Ocean Market to publish and sell data, or browse and buy data. Data is publi
As a data scientist or AI practitioner, you can benefit from access to more data (including private data), crypto-secured provenance in data & AI training, and income opportunities for selling data and curating data.
![Decentralized Exchange Marketplaces](./.gitbook/assets/architecture/feature-marketplaces@2x.webp)
![Decentralized Exchange Marketplaces](.gitbook/assets/architecture/feature-marketplaces@2x.webp)
The following guides will help you get started with buying and selling data:
- [Publish a data asset](using-ocean-market/marketplace-publish-data-asset.md)
- [Download a data asset](using-ocean-market/marketplace-download-data-asset.md)
- [Publishing with hosting services](using-ocean-market/asset-hosting.md)
* [Publish a data asset](using-ocean-market/marketplace-publish-data-asset.md)
* [Download a data asset](using-ocean-market/marketplace-download-data-asset.md)
* [Publishing with hosting services](using-ocean-market/asset-hosting.md)
### Build Your Own Data Market
Use Ocean Protocol software tools to build your own data marketplace, by either forking [Ocean Market](https://v4.market.oceanprotocol.com/) code or building up with Ocean components.
![Ocean Market Homepage](./.gitbook/assets/ocean-market-homepage.png)
![Ocean Market Homepage](.gitbook/assets/ocean-market-homepage.png)
If you're interested in starting your own marketplace checkout the following guides:
- [Forking Ocean Market](building-with-ocean/build-a-marketplace/forking-ocean-market.md)
- [Customising your market](building-with-ocean/build-a-marketplace/customising-your-market.md)
- [Deploying your market](building-with-ocean/build-a-marketplace/deploying-market.md)
* [Forking Ocean Market](building-with-ocean/build-a-marketplace/forking-ocean-market.md)
* [Customising your market](building-with-ocean/build-a-marketplace/customising-your-market.md)
* [Deploying your market](building-with-ocean/build-a-marketplace/deploying-market.md)
### Manage datatokens and data NFTs for use in DeFi
@ -65,7 +65,7 @@ Use Ocean [JavaScript](https://github.com/oceanprotocol/ocean.js) or [Python](ht
Ocean-based apps make data asset on-ramps and off-ramps easy for end users. Ocean smart contracts and libraries make this easy for developers. The data itself does not need to be on-chain, just the access control.
![New Data on-ramp and off-ramp](./.gitbook/assets/architecture/new-ramp-on-crypto-ramp-off.webp)
![New Data on-ramp and off-ramp](.gitbook/assets/architecture/new-ramp-on-crypto-ramp-off.webp)
Data NFTs are ERC721 tokens representing the unique asset and datatokens are ERC20 tokens to access data services. Each data service gets its own data NFT and one or more type of datatokens.
@ -73,9 +73,9 @@ To access the dataset, you send 1.0 datatokens to the data provider (running Oce
Since datatokens are ERC20, and live on Ethereum mainnet, there's a whole ecosystem to leverage.
- _Publish and access data services:_ downloadable files or compute-to-data. Use Ocean to deploy a new [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) and [ERC20](https://github.com/ethereum/EIPs/blob/7f4f0377730f5fc266824084188cc17cf246932e/EIPS/eip-20.md) datatoken contract for each data service, then mint datatokens.
- _Transfer datatokens_ to another owner (or approve & transferFrom).
- _And more._ Use ERC20 support in [web3.js](https://web3js.readthedocs.io/), [web3.py](https://web3py.readthedocs.io/en/stable/examples.html#working-with-an-erc20-token-contract) and Solidity to connect datatokens with crypto wallets and other DeFi services.
* _Publish and access data services:_ downloadable files or compute-to-data. Use Ocean to deploy a new [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) and [ERC20](https://github.com/ethereum/EIPs/blob/7f4f0377730f5fc266824084188cc17cf246932e/EIPS/eip-20.md) datatoken contract for each data service, then mint datatokens.
* _Transfer datatokens_ to another owner (or approve & transferFrom).
* _And more._ Use ERC20 support in [web3.js](https://web3js.readthedocs.io/), [web3.py](https://web3py.readthedocs.io/en/stable/examples.html#working-with-an-erc20-token-contract) and Solidity to connect datatokens with crypto wallets and other DeFi services.
### Compute-to-Data
@ -85,7 +85,7 @@ Compute-to-data resolves the tradeoff between the benefits of using private data
The most valuable data is private data — using it can improve research and business outcomes. But concerns over privacy and control make it hard to access. With Compute-to-Data, private data isnt directly shared but rather specific access to it is granted.
![Compute-to-data](./.gitbook/assets/architecture/feature-compute@2x.webp)
![Compute-to-data](.gitbook/assets/architecture/feature-compute@2x.webp)
It can be used for data sharing in science or technology contexts, or in marketplaces for selling private data while preserving privacy, as an opportunity for companies to monetize their data assets.
@ -93,11 +93,11 @@ Private data can help research, leading to life-altering innovations in science
Checkout these guides if you are aiming to get a deeper understanding on how compute-to-data works:
- [Architecture](building-with-ocean/compute-to-data/compute-to-data-architecture.md)
- [Datasets & Algorithms](building-with-ocean/compute-to-data/compute-to-data-datasets-algorithms.md)
- [Minikube Environment](building-with-ocean/compute-to-data/compute-to-data-minikube.md)
- [Writing Algorithms](building-with-ocean/compute-to-data/compute-to-data-algorithms.md)
- [Private docker registry](building-with-ocean/compute-to-data/compute-to-data-docker-registry.md)
* [Architecture](building-with-ocean/compute-to-data/compute-to-data-architecture.md)
* [Datasets & Algorithms](building-with-ocean/compute-to-data/compute-to-data-datasets-algorithms.md)
* [Minikube Environment](building-with-ocean/compute-to-data/compute-to-data-minikube.md)
* [Writing Algorithms](building-with-ocean/compute-to-data/compute-to-data-algorithms.md)
* [Private docker registry](building-with-ocean/compute-to-data/compute-to-data-docker-registry.md)
## How does it work?
@ -107,23 +107,23 @@ Ocean Protocol provides tools for developers to _build data markets_, and to _ma
If you are new to web3 and blockchain technologies then we suggest you first read these introductory guides:
- [Wallet Basics](building-with-ocean/wallets.md)
- [Set Up MetaMask Wallet](orientation/metamask-setup.md)
- [Manage Your OCEAN Tokens](building-with-ocean/wallets-and-ocean-tokens.md)
* [Wallet Basics](building-with-ocean/wallets.md)
* [Set Up MetaMask Wallet](orientation/metamask-setup.md)
* [Manage Your OCEAN Tokens](building-with-ocean/wallets-and-ocean-tokens.md)
If ou are looking to get to grips with the inner workings of Ocean, then you'll be interested in the following guides:
- [Architecture Overview](./core-concepts/architecture.md)
- [Data NFTs and Datatokens](./core-concepts/datanft-and-datatoken.md)
- [Networks](./core-concepts/networks.md)
- [Fees](./core-concepts/fees.md)
- [Asset pricing](./core-concepts/asset-pricing.md)
- [DID & DDO](./core-concepts/did-ddo.md)
- [Roles](./core-concepts/roles.md)
- [Set Up a Marketplace](./building-with-ocean/marketplace.md)
- [Compute-to-Data](./building-with-ocean/compute-to-data/README.md)
- [Deploying components](building-with-ocean/deploying-components/README.md)
- [Contributing](core-concepts/contributing.md)
* [Architecture Overview](core-concepts/architecture.md)
* [Data NFTs and Datatokens](core-concepts/datanft-and-datatoken.md)
* [Networks](core-concepts/networks.md)
* [Fees](core-concepts/fees.md)
* [Asset pricing](core-concepts/asset-pricing.md)
* [DID & DDO](core-concepts/did-ddo.md)
* [Roles](core-concepts/roles.md)
* [Set Up a Marketplace](building-with-ocean/marketplace.md)
* [Compute-to-Data](building-with-ocean/compute-to-data/)
* [Deploying components](building-with-ocean/deploying-components/)
* [Contributing](core-concepts/contributing.md)
## Supporters

View File

@ -1,73 +1,63 @@
# Table of contents
- [🌊 Discover](README.md)
- [Wallet Basics](discover/wallets.md)
- [Set Up MetaMask Wallet](discover/metamask-setup.md)
- [Manage Your OCEAN Tokens](discover/wallets-and-ocean-tokens.md)
- [Networks](discover/networks.md)
- [Bridges](discover/bridges.md)
- [FAQ](discover/faq.md)
- [📚 Tutorials](tutorials/README.m)
- [Using Ocean Market](tutorials/using-ocean-market/README.md)
- [Publish a Data Asset](tutorials/using-ocean-market/marketplace-publish-data-asset.md)
- [Download a Data Asset](tutorials/using-ocean-market/marketplace-download-data-asset.md)
- [Publishing with Hosting Services](tutorials/using-ocean-market/asset-hosting.md)
- [Liquidity Pools \[deprecated\]](tutorials/using-ocean-market/remove-liquidity-using-etherscan.md)
- [Build a Marketplace](tutorials/build-a-marketplace/README.md)
- [Forking Ocean Market](tutorials/build-a-marketplace/forking-ocean-market.md)
- [Customising a Market](tutorials/build-a-marketplace/customising-your-market.md)
- [Deploying a Market](tutorials/build-a-marketplace/deploying-market.md)
- [Using Ocean Subgraph](tutorials/using-ocean-subgraph/README.md)
- [List data NFTs](tutorials/using-ocean-subgraph/list-data-nfts.md)
- [List all Tokens](tutorials/using-ocean-subgraph/list-datatokens.md)
- [Get Data NFT Information](tutorials/using-ocean-subgraph/get-data-nft-information.md)
- [Get Datatoken Information](tutorials/using-ocean-subgraph/get-datatoken-information.md)
- [List Fixed Rate Exchanges](building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md)
- [Using Ocean Libraries](tutorials/using-ocean-libraries/README.md)
- [Configuration](tutorials/using-ocean-libraries/configuration.md)
- [Creating a data NFT](tutorials/using-ocean-libraries/creating_dataNFT.md)
- [Publish with Fixed Pricing](tutorials/using-ocean-libraries/create-datatoken-with-fixed-pricing.md)
- [Mint Datatokens](tutorials/using-ocean-libraries/mint-datatoken.md)
- [Update Metadata](tutorials/using-ocean-libraries/update-metadata.md)
- [💰 Rewards](rewards/README.md)
- [veOCEAN](rewards/veocean.md)
- [Data Farming 101](rewards/df-intro.md)
- [Data Farming Background](rewards/df-background.md)
- [Emissions & APYs](rewards/emissions-apys.md)
- [Rewards Tutorial](rewards/veOcean-Data-Farming-Tutorial.md)
- [👨‍💻 Developers](developers/README.md)
- [Core concepts](developers/core-concepts/README.md)
- [Architecture Overview](developers/core-concepts/architecture.md)
- [Data NFTs and Datatokens](developers/core-concepts/datanft-and-datatoken.md)
- [Roles](developers/core-concepts/roles.md)
- [Fees](developers/core-concepts/fees.md)
- [Asset Pricing](developers/core-concepts/asset-pricing.md)
- [DID & DDO](developers/core-concepts/did-ddo.md)
- [C2D - Architecture](developers/core-concepts/compute-to-data-architecture.md)
- [C2D - Datasets & Algorithms](developers/core-concepts/compute-to-data-datasets-algorithms.md)
- [C2D - Writing Algorithms](developers/core-concepts/compute-to-data-algorithms.md)
- [C2D - User defined parameters](developers/core-concepts/user-defined-parameters.md)
- [Aquarius REST API](developers/api-references/aquarius-rest-api.md)
- [Provider REST API](developers/api-references/provider-rest-api.md)
- [🔨 Infrastructure](infrastructure/deploying-components/README.md)
- [Setup a Server](infrastructure/setup-server.md)
- [Deploying Marketplace](infrastructure/deploying-marketplace.md)
- [Deploying Aquarius](infrastructure/deploying-aquarius.md)
- [Deploying Provider](infrastructure/deploying-provider.md)
- [Deploying Ocean Subgraph](infrastructure/deploying-ocean-subgraph.md)
- [C2D - Minikube Environment](infrastructure/compute-to-data-minikube.md)
- [C2D - Private Docker Registry](infrastructure/compute-to-data-docker-registry.md)
- [🤝 Contribute](contribute/contributing.md)
- [Partners & Collaborators](contribute/projects-using-ocean.md)
- [Contributor Code of Conduct](contribute/code-of-conduct.md)
- [Legal Requirements](contribute/legal-reqs.md)
* [🌊 Discover](README.md)
* [Wallet Basics](discover/wallets.md)
* [Set Up MetaMask Wallet](discover/metamask-setup.md)
* [Manage Your OCEAN Tokens](discover/wallets-and-ocean-tokens.md)
* [Networks](discover/networks.md)
* [Bridges](discover/bridges.md)
* [FAQ](discover/faq.md)
* [📚 Tutorials](tutorials/README.md)
* [Using Ocean Market](tutorials/using-ocean-market/README.md)
* [Publish a Data Asset](tutorials/using-ocean-market/marketplace-publish-data-asset.md)
* [Download a Data Asset](tutorials/using-ocean-market/marketplace-download-data-asset.md)
* [Publishing with Hosting Services](tutorials/using-ocean-market/asset-hosting.md)
* [Liquidity Pools \[deprecated\]](tutorials/using-ocean-market/remove-liquidity-using-etherscan.md)
* [Build a Marketplace](tutorials/build-a-marketplace/README.md)
* [Forking Ocean Market](tutorials/build-a-marketplace/forking-ocean-market.md)
* [Customising a Market](tutorials/build-a-marketplace/customising-your-market.md)
* [Deploying a Market](tutorials/build-a-marketplace/deploying-market.md)
* [Using Ocean Subgraph](tutorials/using-ocean-subgraph/README.md)
* [List data NFTs](tutorials/using-ocean-subgraph/list-data-nfts.md)
* [List all Tokens](tutorials/using-ocean-subgraph/list-datatokens.md)
* [Get Data NFT Information](tutorials/using-ocean-subgraph/get-data-nft-information.md)
* [Get Datatoken Information](tutorials/using-ocean-subgraph/get-datatoken-information.md)
* [List Fixed Rate Exchanges](tutorials/using-ocean-subgraph/list-fixed-rate-exchanges.md)
* [Using Ocean Libraries](tutorials/using-ocean-libraries/README.md)
* [Configuration](tutorials/using-ocean-libraries/configuration.md)
* [Creating a data NFT](tutorials/using-ocean-libraries/creating\_dataNFT.md)
* [Publish with Fixed Pricing](tutorials/using-ocean-libraries/create-datatoken-with-fixed-pricing.md)
* [Mint Datatokens](tutorials/using-ocean-libraries/mint-datatoken.md)
* [Update Metadata](tutorials/using-ocean-libraries/update-metadata.md)
* [💰 Rewards](rewards/README.md)
* [veOCEAN](rewards/veocean.md)
* [Data Farming 101](rewards/df-intro.md)
* [Data Farming Background](rewards/df-background.md)
* [Emissions & APYs](rewards/emissions-apys.md)
* [Rewards Tutorial](rewards/veOcean-Data-Farming-Tutorial.md)
* [👨💻 Developers](developers/README.md)
* [Core concepts](developers/core-concepts/README.md)
* [Architecture Overview](developers/core-concepts/architecture.md)
* [Data NFTs and Datatokens](developers/core-concepts/datanft-and-datatoken.md)
* [Roles](developers/core-concepts/roles.md)
* [Fees](developers/core-concepts/fees.md)
* [Asset Pricing](developers/core-concepts/asset-pricing.md)
* [DID & DDO](developers/core-concepts/did-ddo.md)
* [C2D - Architecture](developers/core-concepts/compute-to-data-architecture.md)
* [C2D - Datasets & Algorithms](developers/core-concepts/compute-to-data-datasets-algorithms.md)
* [C2D - Writing Algorithms](developers/core-concepts/compute-to-data-algorithms.md)
* [C2D - User defined parameters](developers/core-concepts/user-defined-parameters.md)
* [Aquarius REST API](developers/aquarius-rest-api.md)
* [Provider REST API](developers/provider-rest-api.md)
* [🔨 Infrastructure](infrastructure/README.md)
* [Setup a Server](infrastructure/setup-server.md)
* [Deploying Marketplace](infrastructure/deploying-marketplace.md)
* [Deploying Aquarius](infrastructure/deploying-aquarius.md)
* [Deploying Provider](infrastructure/deploying-provider.md)
* [Deploying Ocean Subgraph](infrastructure/deploying-ocean-subgraph.md)
* [C2D - Minikube Environment](infrastructure/compute-to-data-minikube.md)
* [C2D - Private Docker Registry](infrastructure/compute-to-data-docker-registry.md)
* [🤝 Contribute](contribute/contributing.md)
* [Partners & Collaborators](contribute/projects-using-ocean.md)
* [Contributor Code of Conduct](contribute/code-of-conduct.md)
* [Legal Requirements](contribute/legal-reqs.md)

View File

@ -3,34 +3,36 @@ title: Ways to Contribute
description: Help to improve and develop Ocean core software.
---
## Report a bug
# 🤝 Contribute
### Report a bug
To report a bug that isn't a vulnerability, go to the relevant GitHub repository, click on the _Issues_ tab and select _Bug report_.
Before reporting a bug, search existing open and closed issues and PRs to see if something has already been reported. If not, then go ahead and create a new bug report, following the structure suggested in the issue template.
## Report Vulnerabilities
### Report Vulnerabilities
You may be able to earn a bounty for reporting vulnerabilities in sensitive parts of our code. Check our page on [Immunify](https://immunefi.com/bounty/oceanprotocol/) for the latest bug bounties available. You can also responsibly disclose flaws by emailing us at <a href="mailto:security@oceanprotocol.com">security@oceanprotocol.com</a>.
You may be able to earn a bounty for reporting vulnerabilities in sensitive parts of our code. Check our page on [Immunify](https://immunefi.com/bounty/oceanprotocol/) for the latest bug bounties available. You can also responsibly disclose flaws by emailing us at [security@oceanprotocol.com](mailto:security@oceanprotocol.com).
## Suggest a new feature
### Suggest a new feature
Use the _Issues_ section of each repository and select _Feature request_ to suggest and discuss any features you would like to see added.
As with bug reports, search existing open and closed issues and PRs to see if something has already been reported.
## Fix or improve core software
### Fix or improve core software
We'd love to have you contribute to any repository within the `oceanprotocol` GitHub organization!
Before you start coding right away, please follow those basic guidelines:
- If no issue for your case is present, open one first before starting to work on something, so it can be discussed.
- Make yourself familiar with eventual repository-specific contribution requirements and code style requirements.
- Because of the weird world of intellectual property, we need you to follow the [legal requirements](./legal-reqs.md) for contributing code.
- Be excellent to each other, as outlined in our [Contributor Code of Conduct](./code-of-conduct.md).
* If no issue for your case is present, open one first before starting to work on something, so it can be discussed.
* Make yourself familiar with eventual repository-specific contribution requirements and code style requirements.
* Because of the weird world of intellectual property, we need you to follow the [legal requirements](legal-reqs.md) for contributing code.
* Be excellent to each other, as outlined in our [Contributor Code of Conduct](code-of-conduct.md).
### Workflow
#### Workflow
A typical code contribution in any Ocean Protocol repository would go as follows:
@ -47,37 +49,30 @@ Depending on the release management of each repository, your contribution will b
Except for GitHub, you can find most Ocean Protocol core developers in [Discord](https://discord.gg/TnXjkR5) if you have further development questions.
## Develop an app or integration on top of Ocean Protocol
### Develop an app or integration on top of Ocean Protocol
Create an app with one of Ocean Protocol's interface points:
<repo name="react"></repo>
<repo name="ocean.js"></repo>
<repo name="ocean.py"></repo>
<repo name="contracts"></repo>
Ocean documentation will help. And... you're here:)
## Improve these docs
### Improve these docs
These docs can always be improved. Every content page has an edit link at its end linking you to the content source on GitHub for simple copy editing.
If you found a technical bug or have an improvement suggestion, head over to the repo's _Issues_ section:
<repo name="docs"></repo>
## Apply for a developer job
### Apply for a developer job
Really love building on Ocean and want to dive deeper? Consider joining us full time. Our openings are listed at https://github.com/oceanprotocol/devjobs.
## Get Funding
### Get Funding
Funding can be for contributing to the core software, building apps, doing integrations, fixing bugs, community outreach, and more. Checkout our active funding programs for more information:
- **[Ocean DAO](https://www.oceanprotocol.com/fund)** (grants curated by the community).
- **[Shipyard](https://oceanprotocol.com/shipyard)** (Ocean curated grants).
- **[Data Bounties](https://oceanprotocol.com/bounties)** (rewards for publishing algorithms and datasets).
* [**Ocean DAO**](https://www.oceanprotocol.com/fund) (grants curated by the community).
* [**Shipyard**](https://oceanprotocol.com/shipyard) (Ocean curated grants).
* [**Data Bounties**](https://oceanprotocol.com/bounties) (rewards for publishing algorithms and datasets).
## Other ways to get involved
### Other ways to get involved
Please go to the [Ocean Community Page](https://www.oceanprotocol.com/community) for more ideas on how to get involved.

View File

@ -1,323 +1,2 @@
# Aquarius REST API
## Assets
### **Get** `/api/aquarius/assets/ddo/<did>`
* Description
Get DDO of a particular asset.
* Parameters
| name | description | type | in | required |
| ----- | ---------------- | ------ | ---- | -------- |
| `did` | DID of the asset | string | path | true |
* Example
```bash
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/ddo/did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6'
```
* Responses
* 200
* content-type: json
* description: On successful operation returns DDO information.
* 404
* content-type: json
* description: This asset DID is not in ES.
* response body:
```
{
"error": "Asset DID <did> not found in Elasticsearch."
}
```
### **GET** `/api/aquarius/assets/metadata/<did>`
* Description
Get metadata of a particular asset.
* Parameters
| name | description | type | in | required |
| ----- | ---------------- | ------ | ---- | -------- |
| `did` | DID of the asset | string | path | true |
* Example
```bash
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/metadata/did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6'
```
* Responses
* 200
* content-type: json
* description: successful operation.
* 404
* content-type: json
* description: This asset DID is not in ES.
* response body:
```
{
"error": "Error encountered while retrieving metadata: NotFoundError(404, '{\"_index\":\"aquarius\",\"_type\":\"_doc\",\"_id\":\"<did>\",\"found\":false}')."
}
```
### **POST** `/api/aquarius/assets/names`
* Description
Get names of assets as specified in the payload.
* Parameters
| name | description | type | in | required |
| --------- | ------------------ | ---- | ---- | -------- |
| `didList` | list of asset DIDs | list | body | true |
* Example
```bash
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/names' \
--header 'Content-Type: application/json' \
--data-raw '{
"didList" : ["did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6"]
}'
```
* Responses
* 200
* content-type: json
* description: successful operation.
* response body:
```
{"did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6": "Ocean CEX Aggregator: OHLC history for OCEAN/USDT "}
```
* 400
* content-type: json
* description: This asset DID is not in ES.
* response body:
```
{
"error": "The requested didList can not be empty."
}
```
### **POST** `/api/aquarius/assets/query`
* Description
Run a native ES query. Body must be a valid json object.
* Example
```bash
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/query' \
--header 'Content-Type: application/json' \
--data-raw '{
"query": {
"match_all": {}
}
}'
```
* Responses
* 200
* content-type: json
* 500
* description: elasticsearch exception
### **POST** `/api/aquarius/assets/ddo/validate`
* Description
Validate DDO content. Cosumes `application/octet-stream`
* Example
```bash
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/query/api/v1/aquarius/assets/ddo/validate' \
--header 'Content-Type: application/json' \
--data-raw '<json_body>'
```
* Valid body
```
{
"@context": ["https://w3id.org/did/v1"],
"id": "did:op:56c3d0ac76c02cc5cec98993be2b23c8a681800c08f2ff77d40c895907517280",
"version": "4.1.0",
"chainId": 1337,
"nftAddress": "0xabc",
"metadata": {
"created": "2000-10-31T01:30:00.000-05:00Z",
"updated": "2000-10-31T01:30:00.000-05:00",
"name": "Ocean protocol white paper",
"type": "dataset",
"description": "Ocean protocol white paper -- description",
"author": "Ocean Protocol Foundation Ltd.",
"license": "CC-BY",
"contentLanguage": "en-US",
"tags": ["white-papers"],
"additionalInformation": {"test-key": "test-value"},
"links": [
"http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/",
"http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/",
"http://data.ceda.ac.uk/badc/ukcp09/"
]
},
"services": [
{
"id": "test",
"type": "access",
"datatokenAddress": "0xC7EC1970B09224B317c52d92f37F5e1E4fF6B687",
"name": "Download service",
"description": "Download service",
"serviceEndpoint": "http://172.15.0.4:8030/",
"timeout": 0,
"files": "encryptedFiles"
}
]
}
```
* Responses:
* 200
* description: successfully request.
* 400
* description: Invalid DDO format
* 500
* description: Error
### **POST** `/api/aquarius/assets/triggerCaching`
* Description
Manually triggers DDO caching based on a transacionId containing either MetadataCreated or MetadataUpdated event(s).
* Parameters
| name | description | type | in | required |
| --------------- | ------------------------------------ | ------ | ---- | -------- |
| `transactionId` | DID of the asset | string | path | true |
| `logIndex` | custom log index for the transaction | int | path | false |
* Example
```bash
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/triggerCaching' \
--header 'Content-Type: application/json' \
--data-raw '<json_body>'
```
* Valid body
```
{
"transactionId": "0x945596edf2a26d127514a78ed94fea86b199e68e9bed8b6f6d6c8bb24e451f27",
"logIndex": 0
}
```
* Responses:
* 200
* description: triggering successful, updated asset returned
* 400
* description: request issues: either log index not found, or neither of MetadataCreated, MetadataUpdated found in tx log
* 500
* description: Error
## Chains
### **GET** `/api/aquarius/chains/list`
* Description
Get chains list
* Example
```bash
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/chains/list'
```
* Response
* 200
* Description: Successful request
* Body
```
{ "246": true, "3": true, "137": true,
"2021000": true, "4": true, "1": true,
"56": true, "80001": true, "1287": true
}
```
### **GET** `/api/aquarius/chains/status/{chain_id}`
* Description
Get index status for a specific chain\_id
* Example
```bash
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/chains/status/137'
```
* Response
* 200
* Description: Successful request
* Body
```
{"last_block": 25198729}
```
## Others
### **GET** `/`
* Description
Get version, plugin, and software information.
* Example
```bash
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/'
```
* Response
* 200
* Description: Successful request
* Body
```
{
"plugin": "elasticsearch",
"software": "Aquarius",
"version": "4.2.0"
}
```
### **GET** `/health`
* Description
Get health status
* Example
```bash
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/health'
```
* Response
* 200
* Description: Successful request
* Body
```
Elasticsearch connected
```
### **GET** /spec
* Description
Get swagger spec
* Example
```bash
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/spec'
```
* Response
* 200
* Description: Successful request
### Postman documentation
Click [here](https://documenter.getpostman.com/view/2151723/UVkmQc7r) to explore the documentation and more examples in postman.

View File

@ -1,633 +1,2 @@
# Provider REST API
## Ocean Provider Endpoints Specification
This document specifies the endpoints for Ocean Provider to be implemented by the core developers.
If you want to see the provider URLs for our supported networks, kindly
check for `Provider` component on
this [page](https://docs.oceanprotocol.com/core-concepts/networks).
For inspecting the errors received from `Provider` and their reasons, please revise this
[document](https://github.com/oceanprotocol/provider/blob/main/ocean_provider/routes/README.md).
### nonce endpoint
#### GET /api/services/nonce
Parameters
```
userAddress: String object containing a user's ethereum address
```
Returns: Json object containing the last-used nonce value.
The nonce endpoint is just informative, use the current UTC timestamp as a nonce,
where required in other endpoints.
Example:
```
POST /api/services/nonce?userAddress=0x990922334
```
Response:
```json
{
"nonce": 23
}
```
### Encrypt endpoint
#### GET /api/services/encrypt
Body: binary application/octet-stream
Returns: Bytes string containing the encrypted document.
Example:
```
POST /api/services/encrypt
body: b'\xfd7zXZ\x00\x00\x04\xe6\xd6\xb4F\ ... \x00\x04YZ'
```
Response:
```
b'0x04b2bfab1f4e...7ed0573'
```
### Decrypt endpoint
#### POST /api/services/decrypt
Parameters
```
decrypterAddress: String object containing the address of the decrypter (required)
chainId: the chain id of the network the document is on (required)
transactionId: the transaction id of the encrypted document (optional)
dataNftAddress: the address of the data nft (optional)
encryptedDocument: the encrypted document (optional)
flags: the flags of the encrypted document (optional)
documentHash: the hash of the encrypted document (optional)
nonce: the nonce of the encrypted document (required)
signature: the signature of the encrypted document (required)
```
Returns: Bytes string containing the decrypted document.
Example:
```
POST /api/services/decrypt
payload: {
'decrypterAddress':'0xA78deb2Fa79463945C247991075E2a0e98Ba7A09'
'chainId':8996
'dataNftAddress':'0xBD558814eE914800EbfeF4a1cbE196F5161823d9'
'encryptedDocument':'0xfd377a585a0...f07afef7dc214'
'flags': 1
'documentHash':'0x0cb38a7bba49758a86f8556642aff655d00e41da28240d5ea0f596b74094d91f'
'nonce':'1644315615.24195'
'signature':'0xd6f27047853203824ab9e5acef87d0a501a64aee93f33a83b6f91cbe8fb4489824defceaccde91273f41290cb2a0c15572368e8bea0b456c7a653659cad7de311b'
}
```
Response:
```
b'{"@context": ["https://w3id.org/did/v1"], "id": "did:op:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c ...'
```
### File info endpoint
#### POST /api/services/fileinfo
Retrieves Content-Type and Content-Length from the given URL or asset.
Parameters
For published assets:
```
{
did: String, DID of the dataset
serviceId: String, ID of the service
}
```
For file objects,see https://docs.oceanprotocol.com/core-concepts/did-ddo#files
If checksum is requests, file size should be lower < MAX_CHECKSUM_LENGTH (see Provider ENVs)
If file is larger, checksum WILL NOT be computed.
Returns: Json document file info object
Example:
```
POST /api/services/fileinfo
payload:
{
"did":"0x1111",
"serviceId": "0",
}
```
Response:
```json
[
{
"contentLength":"1161",
"contentType":"application/json",
"index":0,
"valid": true
},...
]
```
### Initial service request endpoint
#### GET /api/services/initialize
Parameters
```
documentId: String object containing document id (e.g. a DID)
serviceId: String, ID of the service the datatoken is attached to
consumerAddress: String object containing consumer's address
environment: String representing a compute environment offered by the provider
validUntil: Integer, date of validity of the service (optional)
fileIndex: Integer, the index of the file from the files list in the dataset. If set, provider will validate the file access. (optional)
```
Returns: Json document with a quote for amount of tokens to transfer to the provider account.
Example:
```
GET /api/services/initialize
payload:
{
"documentId":"0x1111",
"serviceId": 0,
"consumerAddress":"0x990922334",
}
payload (with optional parameters):
{
"documentId":"0x1111",
"serviceId": 0,
"consumerAddress":"0x990922334",
"validUntil": 1578004800,
"fileIndex": 1
}
```
Response:
```json
{
"datatoken": "0x21fa3ea32892091...",
"nonce": 23,
"providerFee": {
"providerFeeAddress": "0xabc123...",
"providerFeeToken": "0xabc123...",
"providerFeeAmount": "200",
"providerData": "0xabc123...",
"v": 27,
"r": "0xabc123...",
"s": "0xabc123...",
"validUntil": 123456,
},
"computeAddress": "0x8123jdf8sdsa..."
}
```
### Download endpoint
#### GET /api/services/download
Parameters
```
documentId: String object containing document id (e.g. a DID)
serviceId: String, representing the list of `file` objects that describe each file in the dataset
transferTxId: Hex string -- the id of on-chain transaction for approval of datatokens transfer
given to the provider's account
fileIndex: integer, the index of the file from the files list in the dataset
nonce: Nonce
consumerAddress: String object containing consumer's address
signature: String object containg user signature (signed message)
```
Returns: File stream. Retrieves the attached asset files.
Example:
```
GET /api/services/download
payload:
{
"documentId":"0x1111",
"serviceId": 0,
"fileIndex": 0,
"datatoken": "",
"consumerAddress":"0x990922334",
"signature":"0x00110011",
"transferTxId": "0xa09fc23421345532e34829"
```
Response:
```json
{
"": ""
}
```
### Compute endpoints
All compute endpoints respond with an Array of status objects, each object describing a compute job info.
Each status object will contain:
```
owner:The owner of this compute job
documentId: String object containing document id (e.g. a DID)
jobId: String object containing workflowId
dateCreated: Unix timestamp of job creation
dateFinished: Unix timestamp when job finished (null if job not finished)
status: Int, see below for list
statusText: String, see below
algorithmLogUrl: URL to get the algo log (for user)
resultsUrls: Array of URLs for algo outputs
resultsDid: If published, the DID
```
Status description (`statusText`): (see Operator-Service for full status list)
| status | Description |
| ------ | ----------------------------- |
| 1 | Warming up |
| 10 | Job started |
| 20 | Configuring volumes |
| 30 | Provisioning success |
| 31 | Data provisioning failed |
| 32 | Algorithm provisioning failed |
| 40 | Running algorith |
| 50 | Filtering results |
| 60 | Publishing results |
| 70 | Job completed |
### Create new job or restart an existing stopped job
#### POST /api/services/compute
Start a new job
Parameters
```
signature: String object containg user signature (signed message) (required)
consumerAddress: String object containing consumer's ethereum address (required)
nonce: Integer, Nonce (required)
environment: String representing a compute environment offered by the provider
dataset: Json object containing dataset information
dataset.documentId: String, object containing document id (e.g. a DID) (required)
dataset.serviceId: String, ID of the service the datatoken is attached to (required)
dataset.transferTxId: Hex string, the id of on-chain transaction for approval of datatokens transfer
given to the provider's account (required)
dataset.userdata: Json, user-defined parameters passed to the dataset service (optional)
algorithm: Json object, containing algorithm information
algorithm.documentId: Hex string, the did of the algorithm to be executed (optional)
algorithm.meta: Json object, defines the algorithm attributes and url or raw code (optional)
algorithm.serviceId: String, ID of the service to use to process the algorithm (optional)
algorithm.transferTxId: Hex string, the id of on-chain transaction of the order to use the algorithm (optional)
algorithm.userdata: Json, user-defined parameters passed to the algorithm running service (optional)
algorithm.algocustomdata: Json object, algorithm custom parameters (optional)
additionalDatasets: Json object containing a list of dataset objects (optional)
One of `algorithm.documentId` or `algorithm.meta` is required, `algorithm.meta` takes precedence
```
Returns: Array of `status` objects as described above, in this case the array will have only one object
Example:
```
POST /api/compute
payload:
{
"signature": "0x00110011",
"consumerAddress": "0x123abc",
"nonce": 1,
"environment": "env",
"dataset": {
"documentId": "did:op:2222...",
"serviceId": "compute",
"transferTxId": "0x0232123..."
}
}
```
Response:
```json
[
{
"jobId": "0x1111:001",
"status": 1,
"statusText": "Job started",
...
}
]
```
### Status and Result
#### GET /api/services/compute
Get all jobs and corresponding stats
Parameters
```
signature: String object containg user signature (signed message)
documentId: String object containing document did (optional)
jobId: String object containing workflowID (optional)
consumerAddress: String object containing consumer's address (optional)
At least one parameter from documentId, jobId and owner is required (can be any of them)
```
Returns
Array of `status` objects as described above
Example:
```
GET /api/services/compute?signature=0x00110011&documentId=did:op:1111&jobId=012023
```
Response:
```json
[
{
"owner": "0x1111",
"documentId": "did:op:2222",
"jobId": "3333",
"dateCreated": "2020-10-01T01:00:00Z",
"dateFinished": "2020-10-01T01:00:00Z",
"status": 5,
"statusText": "Job finished",
"algorithmLogUrl": "http://example.net/logs/algo.log",
"resultsUrls": [
"http://example.net/logs/output/0",
"http://example.net/logs/output/1"
],
"resultsDid": "did:op:87bdaabb33354d2eb014af5091c604fb4b0f67dc6cca4d18a96547bffdc27bcf"
},
{
"owner": "0x1111",
"documentId": "did:op:2222",
"jobId": "3334",
"dateCreated": "2020-10-01T01:00:00Z",
"dateFinished": "2020-10-01T01:00:00Z",
"status": 5,
"statusText": "Job finished",
"algorithmLogUrl": "http://example.net/logs2/algo.log",
"resultsUrls": [
"http://example.net/logs2/output/0",
"http://example.net/logs2/output/1"
],
"resultsDid": ""
}
]
```
#### GET /api/services/computeResult
Allows download of asset data file.
Parameters
```
jobId: String object containing workflowId (optional)
index: Integer, index of the result to download (optional)
consumerAddress: String object containing consumer's address (optional)
nonce: Integer, Nonce (required)
signature: String object containg user signature (signed message)
```
Returns: Bytes string containing the compute result.
Example:
```
GET /api/services/computeResult?index=0&consumerAddress=0xA78deb2Fa79463945C247991075E2a0e98Ba7A09&jobId=4d32947065bb46c8b87c1f7adfb7ed8b&nonce=1644317370
```
Response:
```
b'{"result": "0x0000000000000000000000000000000000000000000000000000000000000001"}'
```
### Stop
#### PUT /api/services/compute
Stop a running compute job.
Parameters
```
signature: String object containg user signature (signed message)
documentId: String object containing document did (optional)
jobId: String object containing workflowID (optional)
consumerAddress: String object containing consumer's address (optional)
At least one parameter from documentId,jobId and owner is required (can be any of them)
```
Returns
Array of `status` objects as described above
Example:
```
PUT /api/services/compute?signature=0x00110011&documentId=did:op:1111&jobId=012023
```
Response:
```json
[
{
...,
"status": 7,
"statusText": "Job stopped",
...
}
]
```
### Delete
#### DELETE /api/services/compute
Delete a compute job and all resources associated with the job. If job is running it will be stopped first.
Parameters
```
signature: String object containg user signature (signed message)
documentId: String object containing document did (optional)
jobId: String object containing workflowId (optional)
consumerAddress: String object containing consumer's address (optional)
At least one parameter from documentId, jobId is required (can be any of them)
in addition to consumerAddress and signature
```
Returns
Array of `status` objects as described above
Example:
```
DELETE /api/services/compute?signature=0x00110011&documentId=did:op:1111&jobId=012023
```
Response:
```json
[
{
...,
"status": 8,
"statusText": "Job deleted successfully",
...
}
]
```
#### GET /api/services/computeEnvironments
Allows download of asset data file.
Parameters
```
```
Returns: List of compute environments.
Example:
```
GET /api/services/computeEnvironments
```
Response:
```json
[
{
"cpuType":"AMD Ryzen 7 5800X 8-Core Processor",
"currentJobs":0,
"desc":"This is a mocked environment",
"diskGB":2,
"gpuType":"AMD RX570",
"id":"ocean-compute",
"maxJobs":10,
"nCPU":2,
"nGPU":0,
"priceMin":2.3,
"ramGB":1
},
...
]
```
### Authentication endpoints
Provider offers an alternative to signing each request, by allowing users to generate auth tokens.
The generated auth token can be used until its expiration in all supported requests.
Simply omit the signature parameter and add the AuthToken request header based on a created token.
Please note that if a signature parameter exists, it will take precedence over the AuthToken headers.
All routes that support a signature parameter support the replacement, with the exception of auth-related ones
(createAuthToken and deleteAuthToken need to be signed).
#### GET /api/services/createAuthToken
Allows the user to create an auth token.
Parameters
```
address: String object containing consumer's address (optional)
nonce: Integer, Nonce (required)
signature: String object containg user signature (signed message)
The signature is based on hashing the following parameters:
address + nonce
expiration: valid future UTC timestamp (required)
```
Returns:
Created auth token.
Example:
```
GET /api/services/createAuthToken?address=<your_address>&&nonce=<your_nonce>&&expiration=<expiration>&signature=<your_signature>
```
Inside the angular brackets, the user should provide the valid values for the request.
Response:
```
{"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NjAwNTMxMjksImFkZHJlc3MiOiIweEE3OGRlYjJGYTc5NDYzOTQ1QzI0Nzk5MTA3NUUyYTBlOThCYTdBMDkifQ.QaRqYeSYxZpnFayzPmUkj8TORHHJ_vRY-GL88ZBFM0o"}
```
#### DELETE /api/services/deleteAuthToken
Allows the user to delete an existing auth token before it naturally expires.
Parameters
```
address: String object containing consumer's address (optional)
nonce: Integer, Nonce (required)
signature: String object containg user signature (signed message)
The signature is based on hashing the following parameters:
address + nonce
token: token to be expired
```
Returns:
Success message if token is successfully deleted.
If the token is not found or already expired, returns an error message.
Example:
```
DELETE /api/services/deleteAuthToken?address=<your_address>&&nonce=<your_nonce>&&token=<your_token>&signature=<your_signature>
```
Inside the angular brackets, the user should provide the valid values for the request.
Response:
```
{"success": "Token has been deactivated."}
```

View File

@ -2,9 +2,11 @@
title: Bridges
---
# Binance Smart Chain (BSC) Bridge
# Bridges
## Intro to BSC's Bridge
## Binance Smart Chain (BSC) Bridge
### Intro to BSC's Bridge
BSC provides several bridge options, including:
@ -13,47 +15,47 @@ BSC provides several bridge options, including:
The article [How to Get Started with BSC](https://academy.binance.com/en/articles/how-to-get-started-with-binance-smart-chain-bsc) by Binance Academy provides further details.
### Links
#### Links
* [BSC Wallet Support](https://docs.binance.org/wallets/bsc-wallets.html). Includes MetaMask and Trust Wallet.
* [BSC Bridge](https://www.bnbchain.org/en/bridge)
* [How to set up a custom network in MetaMask](../../orientation/metamask-setup.md#set-up-custom-network)
* [How to set up a custom network in MetaMask](../orientation/metamask-setup.md#set-up-custom-network)
# Polygon (ex Matic) Bridge
## Polygon (ex Matic) Bridge
### Links
#### Links
* [Matic Wallet](https://wallet.polygon.technology/)
* [Matic Bridge](https://wallet.polygon.technology/bridge/)
* [How to set up a custom network in MetaMask](../../orientation/metamask-setup.md#set-up-custom-network)
* [How to set up a custom network in MetaMask](../orientation/metamask-setup.md#set-up-custom-network)
### Intro to Polygon's Bridge
#### Intro to Polygon's Bridge
The Polygon Network (ex Matic) provide us with a bridge (connecting Ethereum & Polygon blockchains), and a dedicated [wallet](https://wallet.polygon.technology/) that simplify the steps of transferring digital assets between the two networks. The wallet connects to your account via Metamask (or any of the other supported wallets).
When you open the wallet link, the wallet will ask to log in. Select your preferred way of connecting and confirm the action. In our guide we'll use Metamask.
![Login options](../../.gitbook/assets/wallet/login-options.png)
![Login options](<../.gitbook/assets/wallet/login-options (1).png>)
In some places, the Polygon Network is still using its old brand Matic. Either you run into Matic or Polygon - it's the exact same thing. For the purpose of this guide, we'll use Matic in the next few paragraphs since the interfaces you're going to use still use the old brand.
For details check the [blog post](https://blog.oceanprotocol.com/ocean-on-polygon-network-8abad19cbf47).
### Deposit Tokens
#### Deposit Tokens
On the main page of the wallet, you can see all tokens you own on the Matic Mainnet. To deposit tokens (transfer them from the Ethereum Mainnet) you can either use the “deposit” button for a selected token or use “Move funds to Matic Mainnet”.
![Main wallet page](../../.gitbook/assets/wallet/main-wallet-page.png)
![Main wallet page](../.gitbook/assets/wallet/main-wallet-page.png)
Both options will redirect you to the bridge interface. In case you chose the second one, use the dropdown and select the token you want to transfer from the Ethereum Mainnet.
![Bridge interface](../../.gitbook/assets/wallet/matic-bridge.png)
![Bridge interface](<../.gitbook/assets/wallet/matic-bridge (1).png>)
Choose the amount to transfer and click the “Transfer” button. Matics bridge interface will guide you through the whole process and the different steps that will occur. Youll need to sign two transactions on the Ethereum Mainnet. The first being the approval for your token to be traded on the Matics bridge and the second one being the deposit.
![Transferring process](../../.gitbook/assets/wallet/transferring-process.png)
![Transferring process](<../.gitbook/assets/wallet/transferring-process (1).png>)
### Withdraw Tokens
#### Withdraw Tokens
The withdrawing tokens process uses the same bridge interface. The only difference being that the withdraw happens from the Matic to the Ethereum Mainnet.
@ -61,12 +63,12 @@ Again the bridge interface will guide you through the different steps.
For more in dept explanation of the deposit and withdraw actions check [the official Polygon (ex Matic) docs](https://docs.matic.network/docs/develop/ethereum-matic/pos/getting-started).
### Sending Tokens
#### Sending Tokens
While in the first two cases, the transactions are signed on the Ethereum Mainnet, transferring tokens between two Matic addresses happens on the Matic Mainnet. Thus its required for you to connect to the Matic network to sign the transactions. You can use the following parameters to set the network in Metamask:
| What | Value |
| ------------------ | ---------------------------------------- |
| ------------------ | --------------------------------- |
| Network Name | `Matic Mainnet` |
| RPC | `https://polygon-rpc.com/` |
| Chain Id | `137` |

View File

@ -1,2 +1,2 @@
# Deploying Components
# 🔨 Infrastructure

View File

@ -2,13 +2,13 @@
description: An overview of Ocean Protocol's governance and incentives mechanisms
---
# veOCEAN & Data Farming
# 💰 Rewards
veOCEAN is a fork of veCRV, and enables you to become a governance participant, eligible to receive rewards and engage with different protocol mechanisms.
The following docs should provide you with sufficient intuition to access, utilize, and build upon the protocol's core incentive and reward system: Data Farming.
![DF Rewards Page](../.gitbook/assets/rewards/df_rewards_page.png)
![DF Rewards Page](../.gitbook/assets/rewards/df\_rewards\_page.png)
## veOCEAN

View File

@ -0,0 +1,2 @@
# 📚 Tutorials

View File

@ -1,254 +1,2 @@
# List 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 use [this table](./#ocean-subgraph-graphiql).
{% endhint %}
#### Query
```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
}
}
}
```
#### Code
{% tabs %}
{% tab title="Python" %}
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.
**Create script**
{% code title="list_fixed_rate_exchanges.py" %}
```python
import requests
import json
query = """
{
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
}
}
}"""
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_fixed_rate_exchanges.py
```
{% endtab %}
{% tab title="Javascript" %}
The javascript below can be used to run the the query. If you wish to change the network, then replace the value of variable `baseUrl` as needed.
#### Create script
{% code title="listFRE.js" %}
```javascript
var axios = require('axios');
const query = `{
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
}
}
}`
const baseUrl = "https://v4.subgraph.mainnet.oceanprotocol.com"
const route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
const url = `${baseUrl}${route}`
var config = {
method: 'post',
url: url,
headers: { "Content-Type": "application/json" },
data: JSON.stringify({ "query": query })
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
```
{% endcode %}
#### Execute script
```bash
node listFRE.js
```
{% endtab %}
{% endtabs %}
#### Response
<details>
<summary>Sample response</summary>
```json
{
"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"
},
"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": []
}
]
}
}
```
</details>