Compute Options
Specification of compute options for assets in Ocean Protocol.
Compute Options
An asset categorized as a compute type
incorporates additional attributes under the compute object
.
These attributes are specifically relevant to assets that fall within the compute category and are not required for assets classified under the access type
. However, if an asset is designated as compute
, it is essential to include these attributes to provide comprehensive information about the compute service associated with the asset.
Attribute | Type | Description |
---|---|---|
|
| If |
|
| If |
| Array of | If not defined, then any published algorithm is allowed. If empty array, then no algorithm is allowed. If not empty any algo published by the defined publishers is allowed. |
| Array of | If not defined, then any published algorithm is allowed. If empty array, then no algorithm is allowed. Otherwise only the algorithms defined in the array are allowed. (see below). |
* Required
Trusted Algorithms
The publisherTrustedAlgorithms
is an array of objects that specifies algorithm permissions. It controls which algorithms can be used for computation. If not defined, any published algorithm is allowed. If the array is empty, no algorithms are allowed. However, if the array is not empty, only algorithms published by the defined publishers are permitted.
The structure of each object within the publisherTrustedAlgorithms
array is as follows:
Attribute | Type | Description |
---|---|---|
|
| The DID of the algorithm which is trusted by the publisher. |
|
| Hash of algorithm's files (as |
|
| Hash of algorithm's image details (as |
To produce filesChecksum
, call the Provider FileInfoEndpoint with parameter withChecksum = True. If the algorithm has multiple files, filesChecksum
is a concatenated string of all files checksums (ie: checksumFile1+checksumFile2 , etc)
To produce containerSectionChecksum
:
Consumer Parameters
Sometimes, the asset needs additional input data before downloading or running a Compute-to-Data job. Examples:
The publisher needs to know the sampling interval before the buyer downloads it. Suppose the dataset URL is
https://example.com/mydata
. The publisher defines a field calledsampling
and asks the buyer to enter a value. This parameter is then added to the URL of the published dataset as query parameters:https://example.com/mydata?sampling=10
.An algorithm that needs to know the number of iterations it should perform. In this case, the algorithm publisher defines a field called
iterations
. The buyer needs to enter a value for theiterations
parameter. Later, this value is stored in a specific location in the Compute-to-Data pod for the algorithm to read and use it.
The consumerParameters
is an array of objects. Each object defines a field and has the following structure:
Attribute | Type | Description |
---|---|---|
|
| The parameter name (this is sent as HTTP param or key towards algo) |
|
| The field type (text, number, boolean, select) |
|
| The field label which is displayed |
|
| If customer input for this field is mandatory. |
|
| The field description. |
|
| The field default value. For select types, |
| Array of | For select types, a list of options. |
* Required
Each option
is an object
containing a single key: value pair where the key is the option name, and the value is the option value.
Algorithms will have access to a JSON file located at /data/inputs/algoCustomData.json
, which contains the keys/values
input data required. Example:
Last updated