getComputeResult
Request a specific result file of a finished compute job.
Usage
import { Nautilus } from '@deltadao/nautilus'
import { Wallet } from 'ethers'
const nautilus = await Nautilus.create(new Wallet('0x1234'))
const resultFileUri = await nautilus.getComputeResult({
jobId: 'abcd1234',
providerUri: 'https://provider.dev.pontus-x.eu'
})
const file = await fetch(resultFileUri)
Returns
string
A one time accessible url to fetch the compute result file.
Unfinished jobs
The compute job has to have completed in order to access result files.
If no results can be accessed an error will be logged and the return value is undefined
.
await nautilus.getComputeResult({
jobId: 'unfinished-job',
providerUri: 'https://provider.dev.pontus-x.eu'
})
[compute] Retrieve results: could not find results for the job.
To learn more about how to check the status of an ongoing compute job, read the getComputeStatus
documentation.
Parameters
config
- Type:
ComputeResultConfig
The configuration object to request the compute result.
This inherits the properties of the ComputeStatusConfig
Additionally the following properties are supported.
Properties
resultIndex (optional)
- Type:
number
The index of the result file that should be accessed. Defaults to 0
.
await nautilus.getComputeResult({
jobId: 'abcd1234',
providerUri: 'https://provider.dev.pontus-x.eu',
resultIndex: 1
})