Skip to content

ComputeAsset

Used to describe datasets when initializing new compute jobs via nautilus.compute()

Usage

This type is used for either the dataset or the additionalDatasets properties when starting compute jobs.

await nautilus.compute({
    dataset: { 
        did: 'did:op:1234abcd...', 
        userdata: { 
            parameter: 'value'
        }, 
    }, 
    algorithm: {
        did: 'did:op:5678wxyz...'
    },
    additionalDatasets: [
        { 
            did: 'did:op:1234abcd...', 
            serviceId: 'custom-service-id', 
        } 
    ]
})

Properties

did

  • Type: string

The decentralized identifier of the asset to compute on.

const dataset = {
    did: 'did:op:1234abcd...'
} satisfies ComputeAsset

serviceId (optional)

  • Type: string

Optionally specify a service to use for computation. Defaults to the first compute service of the asset's metadata.

const dataset = {
    did: 'did:op:1234abcd...', 
    serviceId: 'specific-service-id', 
} satisfies ComputeAsset

userdata (optional)

If the asset requires or allows for custom user parameter input, this can be configured here.

Learn more about how to use custom userdata with your assets in our Consumer Parameters Guide.

const dataset = {
    did: 'did:op:1234abcd...', 
    serviceId: 'specific-service-id',
    userdata: { 
        parameter: 'value', 
        number: 123, 
        boolean: true, 
        select: 'option', 
    } 
} satisfies ComputeAsset