deltaDAO / nautilus

The Data Economy TypeScript Toolkit
https://nautilus.delta-dao.com
Apache License 2.0
4 stars 2 forks source link

[Enhancement] Support "SaaS" as asset type #59

Closed BjBe82 closed 7 months ago

BjBe82 commented 11 months ago

Motivation / Problem

Support "SaaS" as additional asset type. An example can already be found here: https://cooperants.pontus-x.eu/asset/did:op:6fe6ae5f546adf88606a0da158389f44a0801c3fe87ddb6e1f63e9120e07989c but I am not sure how it was created (Portal and Nautilus do not support SaaS as type ... maybe using 'ethers' directly).

The main difference between "algorithm" and "saas" will be the lifetime of the service instance. The "algorithm" will have a finite lifespan, while "saas" might be infinite (based on the contract).

Solution

Extend Metadata::type: 'dataset' | 'algorithm' to Metadata::type: 'dataset' | 'algorithm' | 'saas'.

Possible inconsistencies

The "algorithm" asset takes a MetadataAlgorithm as configuration, which could be 'abused' for "saas" but might be misleading because of the naming. Maybe rename to Metadata(Runtime)Environment.

BjBe82 commented 11 months ago

I found a "solution" to create a SaaS asset (at least that it is displayed as SaaS) it is possible to add "additionalInformation" like this:

 const asset = assetBuilder
    .addAdditionalInformation({
      saas: {
        redirectUrl: '.....',
      },
    })

Nevertheless, i am not sure if this should be the intended way in the future?

moritzkirstein commented 7 months ago

Hi @BjBe82, as recently discussed / mentioned in the Cooperants alignment call, the saas implementation is currently experimental and therefore not supported by nautilus. We will update the documentation accordingly if anything changes and another serviceType gets added, but for now it can be achieved as you described by using the additionalInformation prop.