Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDO Library #1

Open
alexcos20 opened this issue Nov 26, 2024 · 1 comment
Open

DDO Library #1

alexcos20 opened this issue Nov 26, 2024 · 1 comment

Comments

@alexcos20
Copy link
Member

alexcos20 commented Nov 26, 2024

Problems:

  • have did:op ddos with different versions
  • upcoming did:ope , with structure changes & different versions
  • several components (ocean-node, ocean.js) are dealing with DDOs

Solution:

  • let's create a library to handle DDOs
  • move shacl schemas here, in order to do validations

Implementation:

  • one exported abstract class (DDO). Then load the raw DDO, and based on identifier (op, ope) and version, this will return an extended class
  • abstract class will implement common functions like:
    • validate (validate DDO according to shacl schema stored in the library)
    • getServices
    • getMetadata
    • etc (basically everything that ocean.js and ocean-node needs)
  • if needed, extended classes can have their own functions

We should take the same approach as https://github.com/oceanprotocol/ocean-node/blob/main/src/components/storage/index.ts

After the library is ready, we will update ocean.js and ocean-node (both community & enterprise)

@AdriGeorge
Copy link
Collaborator

Do you mean to consolidate the logic for functions like validate, getService, getMetadata, download, and other DDO-related operations into this new library? If so, at the end we can update both Ocean.js and Ocean Node to call this library for handling all DDO operations?
Additionally, should the related DDO interfaces and schemas also reside exclusively in this library? This way, the frontend/CLI could import everything DDO-related from a single library, avoiding the need to manage version 4 from Ocean.js and version 5 from the new library separately. @alexcos20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants