Update Metadata
This tutorial will guide you to update an existing asset published on-chain using Ocean libraries. The tutorial assumes that you already have the did
of the asset which needs to be updated. In this tutorial, we will update the name, description, tags of the data NFT. Please refer the page on DDO to know more about additional the fields which can be updated.
Prerequisites
The variable AQUARIUS_URL and PROVIDER_URL should be set correctly in .env
file
Create a script to update the metadata
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.
Execute the script
We provided several code examples using the Ocean.js library for interacting with the Ocean Protocol. Some highlights from the code examples (compute examples) are:
Minting an NFT - This example demonstrates how to mint an NFT (Non-Fungible Token) using the Ocean.js library. It shows the necessary steps, including creating a NFTFactory instance, defining NFT parameters, and calling the
create()
method to mint the NFT.Publishing a dataset - This example explains how to publish a dataset on the Ocean Protocol network. It covers steps such as creating a DDO, signing the DDO, and publish the dataset.
Consuming a dataset - This example demonstrates how to consume a published dataset. It shows how to search for available assets, retrieve the DDO for a specific asset, order the asset using a specific datatoken, and then download the asset.
You can explore more detailed code examples and explanations on Ocean.js readme.
Last updated