mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
GITBOOK-637: Minor fixes
This commit is contained in:
parent
cac938e6f8
commit
4e158b71dd
@ -1,10 +1,10 @@
|
|||||||
# Configuration
|
# Configuration
|
||||||
|
|
||||||
For obtaining the API keys for blockchain access and set the correct environment variables, please consult [this section](http://localhost:5000/o/mTcjMqA4ylf55anucjH8/s/zQlpIJEeu8x5yl0OLuXn/) first and after proceed with the next steps.
|
For obtaining the API keys for blockchain access and setting the correct environment variables, please consult [this section](http://localhost:5000/o/mTcjMqA4ylf55anucjH8/s/zQlpIJEeu8x5yl0OLuXn/) first and proceed with the next steps.
|
||||||
|
|
||||||
### Create a directory
|
### Create a directory
|
||||||
|
|
||||||
Let's start with creating a working directory where we store the environment variable file, configuration files and the scripts.
|
Let's start with creating a working directory where we store the environment variable file, configuration files, and the scripts.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir my-ocean-project
|
mkdir my-ocean-project
|
||||||
@ -13,9 +13,9 @@ cd my-ocean-project
|
|||||||
|
|
||||||
### Create a `.env` file
|
### Create a `.env` file
|
||||||
|
|
||||||
In the working directory create a `.env` file. The content of this file will store the values for following variables:
|
In the working directory create a `.env` file. The content of this file will store the values for the following variables:
|
||||||
|
|
||||||
<table><thead><tr><th width="241.33333333333331">Variable name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><strong>OCEAN_NETWORK</strong></td><td>Name of the network where the Ocean Protocol's smart contracts are deployed.</td><td>Yes</td></tr><tr><td><strong>OCEAN_NETWORK_URL</strong></td><td>The URL of the Ethereum node (along with API key for non-local networks)**</td><td>Yes</td></tr><tr><td><strong>PRIVATE_KEY</strong></td><td>The private key of the account which you want to use. A private key is made up of 64 hex characters. Make sure you have sufficient balance to pay for the transaction fees.</td><td>Yes</td></tr><tr><td><strong>AQUARIUS_URL</strong></td><td>The URL of the Aquarius. This value is needed when reading an asset from off-chain store.</td><td>No</td></tr><tr><td><strong>PROVIDER_URL</strong></td><td>The URL of the Provider. This value is needed when publishing a new asset or update an existing asset.</td><td>No</td></tr></tbody></table>
|
<table><thead><tr><th width="235.47193347193348">Variable name</th><th width="421">Description</th><th>Required</th></tr></thead><tbody><tr><td><strong>OCEAN_NETWORK</strong></td><td>Name of the network where the Ocean Protocol's smart contracts are deployed.</td><td>Yes</td></tr><tr><td><strong>OCEAN_NETWORK_URL</strong></td><td>The URL of the Ethereum node (along with API key for non-local networks)**</td><td>Yes</td></tr><tr><td><strong>PRIVATE_KEY</strong></td><td>The private key of the account which you want to use. A private key is made up of 64 hex characters. Make sure you have sufficient balance to pay for the transaction fees.</td><td>Yes</td></tr><tr><td><strong>AQUARIUS_URL</strong></td><td>The URL of the Aquarius. This value is needed when reading an asset from off-chain store.</td><td>No</td></tr><tr><td><strong>PROVIDER_URL</strong></td><td>The URL of the Provider. This value is needed when publishing a new asset or update an existing asset.</td><td>No</td></tr></tbody></table>
|
||||||
|
|
||||||
{% hint style="info" %}
|
{% hint style="info" %}
|
||||||
Treat this file as a secret and do not commit this file to git or share the content publicly. If you are using git, then include this file name in `.gitignore` file.
|
Treat this file as a secret and do not commit this file to git or share the content publicly. If you are using git, then include this file name in `.gitignore` file.
|
||||||
@ -78,11 +78,11 @@ Replace `<replace this>` with the appropriate values. \*\*You can see all the ne
|
|||||||
|
|
||||||
### Setup dependencies
|
### Setup dependencies
|
||||||
|
|
||||||
In this step all required dependencies will be installed.
|
In this step, all required dependencies will be installed.
|
||||||
|
|
||||||
### Installation & Usage
|
### Installation & Usage
|
||||||
|
|
||||||
Let's install Oceanjs library into your current project by running:
|
Let's install Ocean.js library into your current project by running:
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{% tab title="Terminal" %}
|
{% tab title="Terminal" %}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Consume Asset
|
# Consume Asset
|
||||||
|
|
||||||
Consuming an asset involves a two-step process: placing an order and then utilizing the order transaction to download and access the asset's files. Let's delve into each step in more detail.
|
Consuming an asset involves a two-step process: **placing an order** and then **utilizing the order** transaction to **download** and **access** the asset's files. Let's delve into each step in more detail.
|
||||||
|
|
||||||
To initiate the ordering process, there are two scenarios depending on the pricing schema of the asset. Firstly, if the asset has a fixed rate pricing schema configured, you would need to acquire the corresponding datatoken by purchasing it. Once you have obtained the datatoken, you send it to the publisher to place the order for the asset.
|
To initiate the ordering process, there are two scenarios depending on the pricing schema of the asset. Firstly, if the asset has a fixed-rate pricing schema configured, you would need to acquire the corresponding datatoken by purchasing it. Once you have obtained the datatoken, you send it to the publisher to place the order for the asset.
|
||||||
|
|
||||||
The second scenario applies when the asset follows a free pricing schema. In this case, you can obtain a free datatoken from the dispenser service provided by Ocean Protocol. Using the acquired free datatoken, you can place the order for the desired asset.
|
The second scenario applies when the asset follows a free pricing schema. In this case, you can obtain a free datatoken from the dispenser service provided by Ocean Protocol. Using the acquired free datatoken, you can place the order for the desired asset.
|
||||||
|
|
||||||
@ -24,12 +24,12 @@ Later on, when working with the ocean.js library, you can use this order transac
|
|||||||
* [Create a configuration file](configuration.md#create-a-configuration-file)
|
* [Create a configuration file](configuration.md#create-a-configuration-file)
|
||||||
|
|
||||||
{% hint style="info" %}
|
{% hint style="info" %}
|
||||||
The variable **AQUARIUS\_URL** and **PROVIDER\_URL** should be set correctly in `.env` file
|
The variables **AQUARIUS\_URL** and **PROVIDER\_URL** should be set correctly in `.env` file
|
||||||
{% endhint %}
|
{% endhint %}
|
||||||
|
|
||||||
#### Create a script to consume an asset
|
#### Create a script to consume an asset
|
||||||
|
|
||||||
Create a new file in the same working directory where configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
|
Create a new file in the same working directory where the configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
|
||||||
|
|
||||||
<pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">// Note: Make sure .env file and config.js are created and setup correctly
|
<pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">// Note: Make sure .env file and config.js are created and setup correctly
|
||||||
const { oceanConfig } = require('./config.js');
|
const { oceanConfig } = require('./config.js');
|
||||||
|
@ -2,14 +2,7 @@
|
|||||||
|
|
||||||
In the Ocean Protocol ecosystem, each asset is associated with a state that is maintained by the NFT (Non-Fungible Token) contract. The [state of an asset](../ddo-specification.md#state) determines its visibility and availability for different actions on platforms like Ocean Market, as well as its appearance in user profiles. The following table outlines the possible states and their characteristics:
|
In the Ocean Protocol ecosystem, each asset is associated with a state that is maintained by the NFT (Non-Fungible Token) contract. The [state of an asset](../ddo-specification.md#state) determines its visibility and availability for different actions on platforms like Ocean Market, as well as its appearance in user profiles. The following table outlines the possible states and their characteristics:
|
||||||
|
|
||||||
| State | Description | Discoverable in Ocean Market | Ordering Allowed | Listed Under Profile |
|
<table><thead><tr><th width="93">State</th><th width="236">Description</th><th width="140">Discoverable in Ocean Market</th><th width="160">Ordering Allowed</th><th>Listed Under Profile</th></tr></thead><tbody><tr><td><code>0</code></td><td>Active</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td><code>1</code></td><td>End-of-life</td><td>No</td><td>No</td><td>No</td></tr><tr><td><code>2</code></td><td>Deprecated (by another asset)</td><td>No</td><td>No</td><td>No</td></tr><tr><td><code>3</code></td><td>Revoked by publisher</td><td>No</td><td>No</td><td>No</td></tr><tr><td><code>4</code></td><td>Ordering is temporarily disabled</td><td>Yes</td><td>No</td><td>Yes</td></tr><tr><td><code>5</code></td><td>Asset unlisted</td><td>No</td><td>Yes</td><td>Yes</td></tr></tbody></table>
|
||||||
| ----- | -------------------------------- | ---------------------------- | ---------------- | -------------------- |
|
|
||||||
| `0` | Active | Yes | Yes | Yes |
|
|
||||||
| `1` | End-of-life | No | No | No |
|
|
||||||
| `2` | Deprecated (by another asset) | No | No | No |
|
|
||||||
| `3` | Revoked by publisher | No | No | No |
|
|
||||||
| `4` | Ordering is temporarily disabled | Yes | No | Yes |
|
|
||||||
| `5` | Asset unlisted | No | Yes | Yes |
|
|
||||||
|
|
||||||
Now let's explain each state in more detail:
|
Now let's explain each state in more detail:
|
||||||
|
|
||||||
@ -22,7 +15,7 @@ Now let's explain each state in more detail:
|
|||||||
|
|
||||||
By assigning specific states to assets, Ocean Protocol enables a structured approach to asset management and visibility. These states help regulate asset discoverability, ordering permissions, and the representation of assets in user profiles, ensuring a controlled and reliable asset ecosystem.
|
By assigning specific states to assets, Ocean Protocol enables a structured approach to asset management and visibility. These states help regulate asset discoverability, ordering permissions, and the representation of assets in user profiles, ensuring a controlled and reliable asset ecosystem.
|
||||||
|
|
||||||
It is possible to remove assets from Ocean Protocol by modifying the state of the asset. Each asset has a state, which is stored in the NFT contract. Additional details regarding asset states can be found at this link: [https://docs.oceanprotocol.com/core-concepts/did-ddo#state](https://docs.oceanprotocol.com/core-concepts/did-ddo#state). There is also an assets purgatory that contains information about the purgatory status of an asset, as defined in the list-purgatory. For more information about the purgatory, please refer to: [https://docs.oceanprotocol.com/core-concepts/did-ddo#purgatory](https://docs.oceanprotocol.com/core-concepts/did-ddo#purgatory).
|
It is possible to remove assets from Ocean Protocol by modifying the state of the asset. Each asset has a state, which is stored in the NFT contract. Additional details regarding asset states can be found at this [link](../ddo-specification.md#state). There is also an assets purgatory that contains information about the purgatory status of an asset, as defined in the list-purgatory. For more information about the purgatory, please refer to: [https://docs.oceanprotocol.com/core-concepts/did-ddo#purgatory](https://docs.oceanprotocol.com/core-concepts/did-ddo#purgatory).
|
||||||
|
|
||||||
We can utilize a portion of the previous tutorial on updating metadata and incorporate the steps to update the asset's state in the asset DDO.
|
We can utilize a portion of the previous tutorial on updating metadata and incorporate the steps to update the asset's state in the asset DDO.
|
||||||
|
|
||||||
@ -34,12 +27,12 @@ We can utilize a portion of the previous tutorial on updating metadata and incor
|
|||||||
* [Create a configuration file](configuration.md#create-a-configuration-file)
|
* [Create a configuration file](configuration.md#create-a-configuration-file)
|
||||||
|
|
||||||
{% hint style="info" %}
|
{% hint style="info" %}
|
||||||
The variable **AQUARIUS\_URL** and **PROVIDER\_URL** should be set correctly in `.env` file
|
The variables **AQUARIUS\_URL** and **PROVIDER\_URL** should be set correctly in `.env` file
|
||||||
{% endhint %}
|
{% endhint %}
|
||||||
|
|
||||||
#### Create a script to update the state of an asset by updating the assets metatada
|
#### Create a script to update the state of an asset by updating the asset's metatada
|
||||||
|
|
||||||
Create a new file in the same working directory where configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
|
Create a new file in the same working directory where the configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
|
||||||
|
|
||||||
{% code overflow="wrap" %}
|
{% code overflow="wrap" %}
|
||||||
```javascript
|
```javascript
|
||||||
@ -87,4 +80,3 @@ updateAssetState(did).then(() => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
{% endcode %}
|
{% endcode %}
|
||||||
|
|
||||||
|
@ -26,19 +26,19 @@ Go to the Azure portal: https://portal.azure.com/#home and select `Storage accou
|
|||||||
|
|
||||||
**Fill in the details**
|
**Fill in the details**
|
||||||
|
|
||||||
![Add details](../../.gitbook/assets/hosting/azure3.png)
|
![Add details](<../../.gitbook/assets/hosting/azure3 (1).png>)
|
||||||
|
|
||||||
**Storage account created**
|
**Storage account created**
|
||||||
|
|
||||||
![Storage account created](<../../.gitbook/assets/hosting/azure4 (1).png>)
|
![Storage account created](../../.gitbook/assets/hosting/azure4.png)
|
||||||
|
|
||||||
**Step 2 - Create a blob container**
|
**Step 2 - Create a blob container**
|
||||||
|
|
||||||
![Create a blob container](<../../.gitbook/assets/hosting/azure5 (1).png>)
|
![Create a blob container](../../.gitbook/assets/hosting/azure5.png)
|
||||||
|
|
||||||
**Step 3 - Upload a file**
|
**Step 3 - Upload a file**
|
||||||
|
|
||||||
![Upload a file](../../.gitbook/assets/hosting/azure6.png)
|
![Upload a file](<../../.gitbook/assets/hosting/azure6 (1).png>)
|
||||||
|
|
||||||
**Step 4 - Share the file**
|
**Step 4 - Share the file**
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ Go to the Azure portal: https://portal.azure.com/#home and select `Storage accou
|
|||||||
|
|
||||||
**Configure the SAS details and click `Generate SAS token and URL`**
|
**Configure the SAS details and click `Generate SAS token and URL`**
|
||||||
|
|
||||||
![Generate link to file](<../../.gitbook/assets/hosting/azure8 (1).png>)
|
![Generate link to file](../../.gitbook/assets/hosting/azure8.png)
|
||||||
|
|
||||||
**Copy the generated link**
|
**Copy the generated link**
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ Liquidity pools and dynamic pricing used to be supported in previous versions of
|
|||||||
|
|
||||||
4\. Go to field `20. balanceOf` and insert your ETH address. This will retrieve your pool share token balance in wei.
|
4\. Go to field `20. balanceOf` and insert your ETH address. This will retrieve your pool share token balance in wei.
|
||||||
|
|
||||||
<figure><img src="../.gitbook/assets/liquidity/remove-liquidity-2 (3).png" alt=""><figcaption><p>Balance Of</p></figcaption></figure>
|
<figure><img src="../.gitbook/assets/liquidity/remove-liquidity-2.png" alt=""><figcaption><p>Balance Of</p></figcaption></figure>
|
||||||
|
|
||||||
5\. Copy this number as later you will use it as the `poolAmountIn` parameter.
|
5\. Copy this number as later you will use it as the `poolAmountIn` parameter.
|
||||||
|
|
||||||
@ -39,4 +39,4 @@ Liquidity pools and dynamic pricing used to be supported in previous versions of
|
|||||||
|
|
||||||
10\. Confirm transaction in Metamask
|
10\. Confirm transaction in Metamask
|
||||||
|
|
||||||
<figure><img src="../.gitbook/assets/liquidity/remove-liquidity-6 (1).png" alt=""><figcaption><p>Confirm transaction</p></figcaption></figure>
|
<figure><img src="../.gitbook/assets/liquidity/remove-liquidity-6.png" alt=""><figcaption><p>Confirm transaction</p></figcaption></figure>
|
||||||
|
Loading…
Reference in New Issue
Block a user