Skip to content
LogoLogo

setAlgorithm

Set the algorithm metadata of an 'algorithm' type asset.

To learn how to classify your asset as type 'algorithm', please refer to the setType()documentation.

Usage

When defining algorithm type assets, additional metadata is necessary to be set.

import { ,  } from '@deltadao/nautilus'
import {  } from 'ethers'
 
const  = await .(new ('0x1234'))
 
const  = new ()
.({ 
    : { 
        : 'node $ALGO', 
        : 'node', 
        : 'lts', 
        : 'sha256:a6faa1aa0ae1981b70c075dd6ea0a1725a1d05a4cab85536460ae4e4710e8331'
    }, 
}) 
const  = .() 
 
await .() 
ddo.metadata:
{
algorithm: {
container: {
entrypoint: 'node $ALGO',
image: 'node',
tag: 'lts',
checksum: 'sha256:a6faa1aa0ae1981b70c075dd6ea0a1725a1d05a4cab85536460ae4e4710e8331'
}
}
}

Returns

The asset builder instance, to chain further calls with.

Parameters

algorithm

  • Type: MetadataAlgorithm

The algorithms metadata to be specified.

.(
    { 
        : { 
            : 'node $ALGO', 
            : 'node', 
            : 'lts', 
            : 'sha256:a6faa1aa0ae1981b70c075dd6ea0a1725a1d05a4cab85536460ae4e4710e8331'
        }, 
    } 
) 

Properties

For a full overview of algorithm metadata, please refer to the Algorithm Metadata documentation provided by OceanProtocol.