freeCompute
Start a free Compute-to-Data job: no order, no escrow, no payment token.
Usage
const = await .()
const = .(() => .)
const { } = await .({
: { : 'did:ope:1234abcd...' },
: { : 'did:ope:5678wxyz...' },
: ?.
}) New in v2. The environment must expose a free configuration, and its access list may
still restrict who can use it — an environment without one throws, naming it.
Policy-server sessions are still opened for every input, as for
compute: free of charge is not the same as ungated.
On a node with the native SSI module, nautilus opens and verifies an SSI session for every
input whose asset or service has an SSIpolicyV2 (or deprecated SSIpolicy) entry,
algorithm included, before it sends the job. The job start carries them as
{ sessionId, sessionIds: { <did>: <sessionId> } }. The node consumes them when it starts
the job, so each job opens its own and none is cached. A refusal is a PolicyDeniedError
with source: 'ssi' and the node's policyResults (scope, and the DCQL query id as
credential; see access), thrown before the job is
sent. Two inputs that
are services of the same asset and each need their own session are refused with an Error,
since the node looks sessions up by DID.
A free job settles like a paid one: once the algorithm has stopped, the node reports 71
(JobSettle) until its payment-claim run moves the job on to 70, although nothing is
claimed. Wait for dateFinished, as getComputeResult
does, rather than for status 70.
Returns
- Type:
{ jobs: NodeComputeJob[]; environment: ComputeEnvironment }
No orders or initializeResults, because nothing was ordered or quoted.
Parameters
config
- Type:
FreeComputeConfig
The same as ComputeConfig minus paymentToken and
maxJobDuration. Without resources, or with an empty list, they default from the environment's
free.resources: each one's minimum, raised to 1 for cpu, ram and disk within its
maximum; a non-empty resources list is sent exactly as given (see
resources).
Each job's jobId is <environmentHash>-<jobId>, the id every job method takes.
Consumer parameters are checked as in compute: an input's
userdata or the algorithm's algocustomdata that does not fit what the asset declares
throws a ConsumerParameterError before the job is sent, and keys set to undefined or
null are dropped from what is sent.