Skip to content

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)
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2769. Expected: // @errors: 2769 Compiler Errors: index.ts [2769] 352 - No overload matches this call. Overload 1 of 2, '(input: string | URL | Request, init?: RequestInit | undefined): Promise<Response>', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'string | URL | Request'. Type 'undefined' is not assignable to type 'string | URL | Request'. Overload 2 of 2, '(input: URL | RequestInfo, init?: RequestInit | undefined): Promise<Response>', gave the following error. Argument of type 'string | undefined' is not assignable to parameter of type 'URL | RequestInfo'. Type 'undefined' is not assignable to type 'URL | RequestInfo'.

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
})