setType
Set the type of the asset. This might affect what kind of other metadata is expected for the asset to be valid.
See a usage example below for both supported cases: 'dataset' and 'algorithm'.
Usage
When defining algorithm type assets, additional metadata is necessary to be set. Feel free to toggle between the examples below or refer to the setAlgorithm() documentation for further information.
import { , } from '@deltadao/nautilus'
import { } from 'ethers'
const = await .(new ('0x1234'))
const = new ()
.('dataset')
const = .()
await .()
ddo.metadata: { type: 'dataset'}import { , } from '@deltadao/nautilus'
import { } from 'ethers'
const = await .(new ('0x1234'))
const = new ()
.('algorithm')
.({
: {
: 'node $ALGO',
: 'node',
: 'lts',
: 'sha256:a6faa1aa0ae1981b70c075dd6ea0a1725a1d05a4cab85536460ae4e4710e8331'
},
})
const = .()
await .()
ddo.metadata: { type: 'algorithm' algorithm: { container: { entrypoint: 'node $ALGO', image: 'node', tag: 'lts', checksum: 'sha256:a6faa1aa0ae1981b70c075dd6ea0a1725a1d05a4cab85536460ae4e4710e8331' } }}Returns
- Type:
AssetBuilder
The asset builder instance, to chain further calls with.
Parameters
name
- Type:
'dataset' | 'algorithm'
The type to use for the asset's metadata.
Refer to the setAlgorithm() documentation to learn more about required metadata when publishing algorithm assets.
.(
'dataset'
)