diff --git a/README.md b/README.md index 6c7b5f1a..8e46d3fb 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,4 @@ Ocean Protocol provides tools for developers to _build data markets_, and to _ma * _Manage pools._ Deploy OCEAN-datatoken [Balancer](https://www.balancer.fi/) pools, buy & sell datatokens (swap), and add & remove liquidity. * _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** Ocean's "Compute-to-Data" feature gives compute access to privately-held data, which never leaves the data owner’s premises. Ocean-based marketplaces enable the monetization of private data while preserving privacy. [Here](tutorials/compute-to-data-architecture/) are details. +**Compute-to-Data** Ocean's "Compute-to-Data" feature gives compute access to privately-held data, which never leaves the data owner’s premises. Ocean-based marketplaces enable the monetization of private data while preserving privacy. [Here](building-with-ocean/compute-to-data/) are details. diff --git a/SUMMARY.md b/SUMMARY.md index d5622b56..5edcff44 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -1,9 +1,9 @@ # Table of contents * [Orientation](README.md) - * [Wallet Basics](orientation/wallets.md) + * [Wallet Basics](building-with-ocean/wallets.md) * [Set Up MetaMask Wallet](orientation/metamask-setup.md) - * [Use Your Wallet to Manage OCEAN Tokens](orientation/wallets-and-ocean-tokens.md) + * [Use Your Wallet to Manage OCEAN Tokens](building-with-ocean/wallets-and-ocean-tokens.md) * [Core Concepts](core-concepts/README.md) * [Architecture Overview](core-concepts/architecture.md) * [Data NFTs and Datatokens](core-concepts/datanft-and-datatoken.md) diff --git a/building-with-ocean/asset-hosting.md b/building-with-ocean/asset-hosting.md index 5c33925d..5e3297ed 100644 --- a/building-with-ocean/asset-hosting.md +++ b/building-with-ocean/asset-hosting.md @@ -11,7 +11,7 @@ To publish assets on the Ocean Marketplace, publishers must provide a link(an UR On Ocean Marketplace, a publisher must provide the link to the asset during publish step. Once the asset is published, this link cannot be changed. So, it is essential that the publisher correctly sets this field (shown in the below image). -![Publish - File URL field](./images/marketplace/publish/marketplace-publish-file-field.png) +![Publish - File URL field]() ### Hosting services @@ -27,7 +27,7 @@ Open https://drive.google.com and upload the file you want to publish on the Oce The file URL will be of the form `https://drive.google.com/file/d//view?usp=sharing`, where the `` is the unique alphanumeric string. Verify if the URL is correct by entering it in a browser and check if the file is downloaded. -![Google Drive link](./images/marketplace/publish/publish-google-drive.png) +![Google Drive link]() **Step 2 - Create a downloadable link** @@ -41,7 +41,7 @@ Note the `` from step 1 and create a URL as below. After creating a downloadable file URL, fill the `File*` field with the downloadable URL created in step 2. -![Publish - Google Drive file](./images/marketplace/publish/publish-google-drive-2.png) +![Publish - Google Drive file]() _Note: Google Drive allows only shared files to be downloaded, as shown in the above steps. The above method does not work with the shared folder. As a workaround, publishers can upload a zip of a folder and upload it as a file._ @@ -61,47 +61,47 @@ Create an account on [Azure](https://azure.microsoft.com/en-us/). Users might al Go to the Azure portal: https://portal.azure.com/#home and select `Storage accounts` as shown below. -![Create a storage account - 1](./images/marketplace/publish/azure-1.png) +![Create a storage account - 1](images/marketplace/publish/azure-1.png) **Create a new storage account** -![Create a storage account - 2](./images/marketplace/publish/azure-2.png) +![Create a storage account - 2](images/marketplace/publish/azure-2.png) **Fill in the details** -![Add details](./images/marketplace/publish/azure-3.png) +![Add details](images/marketplace/publish/azure-3.png) **Storage account created** -![Storage account created](./images/marketplace/publish/azure-4.png) +![Storage account created](images/marketplace/publish/azure-4.png) **Step 2 - Create a blob container** -![Create a blob container](./images/marketplace/publish/azure-5.png) +![Create a blob container](images/marketplace/publish/azure-5.png) **Step 3 - Upload a file** -![Upload a file](./images/marketplace/publish/azure-6.png) +![Upload a file](images/marketplace/publish/azure-6.png) **Step 4 - Share the file** **Select the file to be published and click Generate SAS** -![Click generate SAS](./images/marketplace/publish/azure-7.png) +![Click generate SAS](images/marketplace/publish/azure-7.png) **Configure the SAS details and click `Generate SAS token and URL`** -![Generate link to file](./images/marketplace/publish/azure-8.png) +![Generate link to file](images/marketplace/publish/azure-8.png) **Copy the generated link** -![Copy the link](./images/marketplace/publish/azure-9.png) +![Copy the link](images/marketplace/publish/azure-9.png) **Step 5 - Publish the asset using the generated link** Now, copy and paste the link in the Publish page in the Ocean Marketplace. -![Publish the file as an asset](./images/marketplace/publish/azure-10.png) +![Publish the file as an asset](images/marketplace/publish/azure-10.png) #### OneDrive @@ -111,17 +111,17 @@ Create an account on [Microsoft](https://www.microsoft.com/en-us/microsoft-365/o Go to [OneDrive](https://onedrive.live.com/) and upload the file to be published. -![Upload a file](./images/marketplace/publish/one-drive-1.png) +![Upload a file](images/marketplace/publish/one-drive-1.png) **Step 2 - Get link** After the file is uploaded, right click on the file and click `Embed`, and copy the link. -![Get an embeddable link](./images/marketplace/publish/one-drive-2.png) +![Get an embeddable link](images/marketplace/publish/one-drive-2.png) Copy the highlighted content as shown in the below image: -![Copy the iframe](./images/marketplace/publish/one-drive-3.png) +![Copy the iframe](images/marketplace/publish/one-drive-3.png) The copied content has the following format: @@ -147,4 +147,4 @@ Enter the URL in the browser and verify if the file is downloaded correctly. Copy and paste the link in the Publish page in the Ocean Marketplace. -![Publish the file as an asset](./images/marketplace/publish/one-drive-4.png) +![Publish the file as an asset](images/marketplace/publish/one-drive-4.png) diff --git a/building-with-ocean/deploying-components/deploying-marketplace.md b/building-with-ocean/deploying-components/deploying-marketplace.md index 27c57e75..84f22643 100644 --- a/building-with-ocean/deploying-components/deploying-marketplace.md +++ b/building-with-ocean/deploying-components/deploying-marketplace.md @@ -15,13 +15,28 @@ cd my-marketplace Copy the below content into the \`.env\` file. -TODO: explain ALLOWED\_PUBLISHERS and EVENTS\_RPC - {% code title=".env" %} ``` -DB_USERNAME=username -DB_PASSWORD=password -# check the available versions: https://hub.docker.com/repository/docker/oceanprotocol/aquarius +#NEXT_PUBLIC_INFURA_PROJECT_ID="xxx" +#NEXT_PUBLIC_MARKET_FEE_ADDRESS="0xxx" +#NEXT_PUBLIC_PUBLISHER_MARKET_ORDER_FEE="1" +#NEXT_PUBLIC_PUBLISHER_MARKET_POOL_SWAP_FEE="1" +#NEXT_PUBLIC_PUBLISHER_MARKET_FIXED_SWAP_FEE="1" +#NEXT_PUBLIC_CONSUME_MARKET_ORDER_FEE="1" +#NEXT_PUBLIC_CONSUME_MARKET_POOL_SWAP_FEE="1" +#NEXT_PUBLIC_CONSUME_MARKET_FIXED_SWAP_FEE="1" + +# +# ADVANCED SETTINGS +# + +# Toggle pricing options presented during price creation +#NEXT_PUBLIC_ALLOW_FIXED_PRICING="true" +#NEXT_PUBLIC_ALLOW_DYNAMIC_PRICING="true" +#NEXT_PUBLIC_ALLOW_FREE_PRICING="true" + +# Privacy Preference Center +#NEXT_PUBLIC_PRIVACY_PREFERENCE_CENTER="true" ``` {% endcode %} @@ -41,10 +56,26 @@ CMD ["npx", "next", "start"] ``` {% endcode %} -Build a docker image +### Create a docker compose file -```bash -docker build . -f Dockerfile -t market:latest +{% code title="docker-compose.market.yml" %} +```yaml +version: "3" +services: + market: + container_name: market + restart: on-failure + build: . + ports: + - 3000:3000 ``` +{% endcode %} ### Start the marketplace + +``` +docker-compose \ +-f docker-compose.market.yml \ +-d \ +up +``` diff --git a/building-with-ocean/images/confirm-backup-phrase.png b/building-with-ocean/images/confirm-backup-phrase.png new file mode 100644 index 00000000..5fa40a1c Binary files /dev/null and b/building-with-ocean/images/confirm-backup-phrase.png differ diff --git a/building-with-ocean/images/create-new-metamask-wallet.png b/building-with-ocean/images/create-new-metamask-wallet.png new file mode 100644 index 00000000..f53a81cd Binary files /dev/null and b/building-with-ocean/images/create-new-metamask-wallet.png differ diff --git a/building-with-ocean/images/manage-tokens.png b/building-with-ocean/images/manage-tokens.png new file mode 100644 index 00000000..09a6f4c4 Binary files /dev/null and b/building-with-ocean/images/manage-tokens.png differ diff --git a/building-with-ocean/images/marketplace/publish/marketplace-publish-file-field (1).png b/building-with-ocean/images/marketplace/publish/marketplace-publish-file-field (1).png new file mode 100644 index 00000000..706aba2d Binary files /dev/null and b/building-with-ocean/images/marketplace/publish/marketplace-publish-file-field (1).png differ diff --git a/building-with-ocean/images/marketplace/publish/publish-google-drive (1).png b/building-with-ocean/images/marketplace/publish/publish-google-drive (1).png new file mode 100644 index 00000000..f472a96f Binary files /dev/null and b/building-with-ocean/images/marketplace/publish/publish-google-drive (1).png differ diff --git a/building-with-ocean/images/marketplace/publish/publish-google-drive-2 (1).png b/building-with-ocean/images/marketplace/publish/publish-google-drive-2 (1).png new file mode 100644 index 00000000..9b126c47 Binary files /dev/null and b/building-with-ocean/images/marketplace/publish/publish-google-drive-2 (1).png differ diff --git a/building-with-ocean/images/metamask-add-network.png b/building-with-ocean/images/metamask-add-network.png new file mode 100644 index 00000000..7b756c36 Binary files /dev/null and b/building-with-ocean/images/metamask-add-network.png differ diff --git a/building-with-ocean/images/metamask-browser-extension.png b/building-with-ocean/images/metamask-browser-extension.png new file mode 100644 index 00000000..7f590505 Binary files /dev/null and b/building-with-ocean/images/metamask-browser-extension.png differ diff --git a/building-with-ocean/images/metamask-chrome-extension.png b/building-with-ocean/images/metamask-chrome-extension.png new file mode 100644 index 00000000..af811b08 Binary files /dev/null and b/building-with-ocean/images/metamask-chrome-extension.png differ diff --git a/building-with-ocean/images/secret-backup-phrase.png b/building-with-ocean/images/secret-backup-phrase.png new file mode 100644 index 00000000..04a2a278 Binary files /dev/null and b/building-with-ocean/images/secret-backup-phrase.png differ diff --git a/orientation/wallets-and-ocean-tokens.md b/building-with-ocean/wallets-and-ocean-tokens.md similarity index 100% rename from orientation/wallets-and-ocean-tokens.md rename to building-with-ocean/wallets-and-ocean-tokens.md diff --git a/orientation/wallets.md b/building-with-ocean/wallets.md similarity index 100% rename from orientation/wallets.md rename to building-with-ocean/wallets.md diff --git a/core-concepts/architecture.md b/core-concepts/architecture.md index 6b17e1dd..cb711e4c 100644 --- a/core-concepts/architecture.md +++ b/core-concepts/architecture.md @@ -18,11 +18,11 @@ Here’s an overview of the figure. * **Aquarius**: Provides metadata cache for faster search by caching on-chain data into elasticsearch * **Provider**: Facilitates downloading assets, DDO encryption, and communicating with `operator-service` for Compute-to-Data jobs. * **The Graph**: It is a 3rd party tool that developers can utilize the libraries to build their custom applications and marketplaces. -* The lowest level has the **smart contracts**. The smart contracts are deployed on the Ethereum mainnet and other compatible networks. Libraries encapsulate the calls to these smart contracts and provide features like publishing new assets, facilitating consumption, managing pricing, and much more. To see the supported networks click [here](../concepts/networks/). +* The lowest level has the **smart contracts**. The smart contracts are deployed on the Ethereum mainnet and other compatible networks. Libraries encapsulate the calls to these smart contracts and provide features like publishing new assets, facilitating consumption, managing pricing, and much more. To see the supported networks click [here](networks.md). ### Data NFTs, Datatokens and Access Control Tools -Data NFTs are based on [ERC721](https://eips.ethereum.org/EIPS/eip-721) standard. The publisher can use Marketplace or client libraries to deploy a new data NFT contract. To save gas fees, it uses [ERC1167](https://eips.ethereum.org/EIPS/eip-1167) proxy approach on the **ERC721 template**. Publisher can then assign manager role to other Ethereum addresses who can deploy new datatoken contracts and even mint them. Each datatoken contract is associated with one data NFT contract. Click [here](../concepts/datanft-and-datatoken/) to further read about data NFTs and datatokens. +Data NFTs are based on [ERC721](https://eips.ethereum.org/EIPS/eip-721) standard. The publisher can use Marketplace or client libraries to deploy a new data NFT contract. To save gas fees, it uses [ERC1167](https://eips.ethereum.org/EIPS/eip-1167) proxy approach on the **ERC721 template**. Publisher can then assign manager role to other Ethereum addresses who can deploy new datatoken contracts and even mint them. Each datatoken contract is associated with one data NFT contract. Click [here](datanft-and-datatoken.md) to further read about data NFTs and datatokens. ERC721 data NFTs represent holding copyright/base IP of a data asset, and ERC20 datatokens represent licenses to access the asset by downloading the content or running Compute-to-Data jobs. diff --git a/orientation/metamask-setup.md b/orientation/metamask-setup.md index 5ddd0ae1..831fd0d5 100644 --- a/orientation/metamask-setup.md +++ b/orientation/metamask-setup.md @@ -8,29 +8,29 @@ description: Tutorial about how to set up MetaMask for Chrome. ### MetaMask Set Up Steps -1. Go to the [Chrome Web Store for extensions](https://chrome.google.com/webstore/category/extensions) and search for MetaMask. +1. Go to the [Chrome Web Store for extensions](https://chrome.google.com/webstore/category/extensions) and search for MetaMask. -![metamask-chrome-store](./images/metamask-chrome-extension.png) +![metamask-chrome-store](../building-with-ocean/images/metamask-chrome-extension.png) -* Install MetaMask. The wallet provides a friendly user interface that will help you through each step. MetaMask gives you two options: importing an existing wallet or creating a new one. Choose to `Create a Wallet`: +* Install MetaMask. The wallet provides a friendly user interface that will help you through each step. MetaMask gives you two options: importing an existing wallet or creating a new one. Choose to `Create a Wallet`: -![Create a wallet](./images/create-new-metamask-wallet.png) +![Create a wallet](../building-with-ocean/images/create-new-metamask-wallet.png) -* In the next step create a new password for your wallet. Read through and accept the terms and conditions. After that, MetaMask will generate Secret Backup Phrase for you. Write it down and store it in a safe place. +* In the next step create a new password for your wallet. Read through and accept the terms and conditions. After that, MetaMask will generate Secret Backup Phrase for you. Write it down and store it in a safe place. -![Secret Backup Phrase](./images/secret-backup-phrase.png) +![Secret Backup Phrase](../building-with-ocean/images/secret-backup-phrase.png) -* Continue forward. On the next page, MetaMask will ask you to confirm the backup phrase. Select the words in the correct sequence: +* Continue forward. On the next page, MetaMask will ask you to confirm the backup phrase. Select the words in the correct sequence: -![Confirm secret backup phrase](./images/confirm-backup-phrase.png) +![Confirm secret backup phrase](../building-with-ocean/images/confirm-backup-phrase.png) -* Voila! Your account is now created. You can access MetaMask via the browser extension in the top right corner of your browser. +* Voila! Your account is now created. You can access MetaMask via the browser extension in the top right corner of your browser. -![MetaMask browser extension](./images/metamask-browser-extension.png) +![MetaMask browser extension](../building-with-ocean/images/metamask-browser-extension.png) -* You can now manage Ether and Ocean Tokens with your wallet. You can copy your account address to the clipboard from the options. When you want someone to send Ether or Ocean Tokens to you, you will have to give them that address. It's not a secret. +* You can now manage Ether and Ocean Tokens with your wallet. You can copy your account address to the clipboard from the options. When you want someone to send Ether or Ocean Tokens to you, you will have to give them that address. It's not a secret. -![Manage tokens](./images/manage-tokens.png) +![Manage tokens](../building-with-ocean/images/manage-tokens.png) You can also watch our [tutorial video snippets](https://www.youtube.com/playlist?list=PL\_dn0wVs9kWolBCbtHaFxsi408cumOeth) if you want more help setting up MetaMask. @@ -40,7 +40,7 @@ Sometimes it is required to use custom or external networks in MetaMask. We can Open the Settings menu and find the `Networks` option. When you open it, you'll be able to see all available networks your MetaMask wallet currently use. Click the `Add Network` button. -![Add custom/external network](./images/metamask-add-network.png) +![Add custom/external network](../building-with-ocean/images/metamask-add-network.png) There are a few empty inputs we need to fill: