Submitting Jobs

How to submit compute jobs to the network

Experimental Feature

This feature is experimental and may change significantly in future versions.

Overview

Compute jobs are the fundamental unit of work in ComputeNet. This guide explains how to prepare, submit, and track compute jobs on the network.

Job Structure

A compute job consists of:

  • Runtime — The execution environment (e.g., WASM)
  • Module — The code to execute
  • Inputs — Data passed to the computation
  • Verification level — Required proof type
  • Resources — Compute limits and timeouts

Supported Runtimes

ComputeNet currently supports (or plans to support):

RuntimeStatusNotes
wasmexperimentalWebAssembly modules
dockerplannedContainer-based execution
zkvmplannedZero-knowledge VM execution

Submitting a Job

submit-job.ts
const job = await client.submit({
  // Execution runtime
  runtime: 'wasm',
  
  // WASM module (as bytes or URL)
  module: wasmBytes,
  
  // Input data
  inputs: {
    data: inputData,
    params: { threshold: 0.5 }
  },
  
  // Verification requirements
  verification: 'full', // 'full' | 'optimistic' | 'attestation'
  
  // Resource limits
  resources: {
    maxGas: 1000000,
    timeout: 60000 // ms
  }
});

// Job submitted - returns job ID
console.log('Job ID:', job.id);

Job States

Jobs progress through the following states:

  1. Pending — Submitted, awaiting validator assignment
  2. Assigned — Validator selected, execution starting
  3. Executing — Computation in progress
  4. Proving — Generating verification proof
  5. Verifying — Attestations being collected
  6. Completed — Result finalized with receipt
  7. Failed — Execution or verification failed

Tracking Progress

track-job.ts
// Poll for status
const status = await client.getJobStatus(job.id);
console.log('State:', status.state);

// Or use event subscription
job.on('stateChange', (newState) => {
  console.log('Job state:', newState);
});

// Wait for completion
const result = await job.waitForCompletion({
  timeout: 120000
});