1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-01 15:55:34 +01:00
docs/developers/ocean.py/publish-flow.md

1.7 KiB

description
This page shows how you can publish a data NFT, a datatoken & a data asset all in once in different scenarios.

Publish flow

ocean.py is a Python library to privately & securely publish, exchange, and consume data, using Ocean Protocol.

In this page, we provide some tips & tricks for publishing an asset on Ocean Market using ocean.py.

We assume you've already (a) installed Ocean, and (b) done local setup or remote setup. This flow works for either one, without any changes between them.

In the Python console:

#data info
name = "Branin dataset"
url = "https://raw.githubusercontent.com/trentmc/branin/main/branin.arff"

#create data asset
(data_nft, datatoken, ddo) = ocean.assets.create_url_asset(name, url, {"from": alice})

#print
print("Just published asset:")
print(f"  data_nft: symbol={data_nft.symbol}, address={data_nft.address}")
print(f"  datatoken: symbol={datatoken.symbol}, address={datatoken.address}")
print(f"  did={ddo.did}")

You've now published an Ocean asset!

  • data_nft is the base (base IP)
  • datatoken for access by others (licensing)
  • ddo holding metadata

For more info, see Appendix: Publish Details.