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

Merge pull request #983 from oceanprotocol/issue-954-file-requirements

Publish tutorials using hosting services/storage providers
This commit is contained in:
Akshay 2022-05-12 11:17:58 +02:00 committed by GitHub
commit 75550cfe43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,103 @@
---
title: Publish assets using hosting services
description: Tutorial to publish assets using hosting services like GDrive and Azure.
---
## Overview
To publish assets on the Ocean Marketplace, publishers must provide a link(an URL) to the file. It is up to the asset publisher to decide where to host the asset. For example, a publisher can store the content on their google drive, AWS server, private cloud server, or other third-party hosting services. Through publishing, the URL of the asset is encrypted and stored as a part of DDO on the blockchain. Buyers don't have access directly to the URL, but they interact with the Provider, which decrypts the URL and acts as a proxy to serve the asset. The DDO only stores the location of the file, which is accessed on-demand by the Provider. Implementing a security policy that allows only the Provider to access the URL and blocks requests from other unauthorized actors is recommended. One of the possible ways to achieve this is to allow only the Provider's IP address to access the URL. But, not all hosting services provide this feature. So, the publishers must consider the security features while choosing a hosting service.
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)
## Hosting services
Publishers can choose any hosting service of their choice. The below section explains how to use commonly used hosting services with Ocean Marketplace.
### Google drive
Google Drive allows users to share files/folders with various access policies. Publishers must set the access policy such that anyone with the link can download the file when using Ocean Marketplace with Ocean Protocol's default [Provider](https://v4.provider.rinkeby.oceanprotocol.com).
#### Step 1 - Get link
Open https://drive.google.com and upload the file you want to publish on the Ocean Marketplace.
Right-click on the uploaded file and click the `Share` option. Set the file access policy correctly and click the `Copy link` button.
The file URL will be of the form `https://drive.google.com/file/d/<FILE-ID>/view?usp=sharing`, where the `<FILE-ID>` is the unique alphanumeric string. Verify if the URL is correct by entering it in a browser and check if the file is downloaded.
![GDrive link](./images/marketplace/publish/publish-google-drive.png)
#### Step 2 - Create a downloadable link
If you paste the copied URL into the browser, it will load an HTML page. Directly pasting the link on the publish page will publish the HTML page instead of a downloadable file URL. So, let's make a downloadable file URL.
Note the `<FILE-ID>` from step 1 and create a URL as below.
`https://drive.google.com/uc?export=download&id=<FILE-ID>`
#### Step 3 - Publish the asset using the generated link
After creating a downloadable file URL, fill the `File*` field with the downloadable URL created in step 2.
![Publish - GDrive file](./images/marketplace/publish/publish-google-drive-2.png)
_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._
---
### Azure storage
Azure provides various options to host data and multiple configuration possibilities. Publishers are required to do their research and decide what would be the right choice. The below steps provide one of the possible ways to host data using Azure storage and publish it on Ocean Marketplace.
#### Prerequisite
Create an account on [Azure](https://azure.microsoft.com/en-us/). Users might also be asked to provide payment details and billing addresses that are out of this tutorial's scope.
#### Step 1 - Create a storage account
##### Go to Azure portal
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 new storage account
![Create a storage account - 2](/images/marketplace/publish/azure-2.png)
##### Fill in the details
![Add details](/images/marketplace/publish/azure-3.png)
##### Storage account created
![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)
#### Step 3 - Upload a file
![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)
##### Configure the SAS details and click `Generate SAS token and URL`
![Generate link to file](/images/marketplace/publish/azure-8.png)
##### Copy the generated link
![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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 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: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -18,6 +18,8 @@
link: /tutorials/marketplace-introduction/ link: /tutorials/marketplace-introduction/
- title: Publish - title: Publish
link: /tutorials/marketplace-publish-data-asset/ link: /tutorials/marketplace-publish-data-asset/
- title: Assets host services
link: /tutorials/assets-host-services/
- title: Download - title: Download
link: /tutorials/marketplace-download-data-asset/ link: /tutorials/marketplace-download-data-asset/
- title: Swap - title: Swap