Building on ComputeNet

Getting started with ComputeNet development

Draft Documentation

This documentation is under development and may be incomplete or subject to change.

Overview

This guide introduces the fundamentals of building applications that leverage ComputeNet for verified computation. You will learn how to submit jobs, verify results, and integrate compute receipts into your applications.

Development Environment

To get started, you will need:

  • Node.js 18+ or Python 3.10+
  • Access to a ComputeNet testnet endpoint
  • The ComputeNet SDK for your language

SDK Installation

Install the SDK using your preferred package manager:

terminal
# JavaScript/TypeScript (planned)
npm install @computenet/sdk

# Python (planned)
pip install computenet-sdk

SDK Under Development

Public SDK packages are not yet available. The examples below show the planned API design.

Basic Usage

A typical workflow involves:

  1. Initialize the client with your configuration
  2. Prepare the compute job with inputs and runtime
  3. Submit the job to the network
  4. Wait for execution and verification
  5. Retrieve and validate the compute receipt

Example: Simple Computation

example.ts
import { ComputeNet } from '@computenet/sdk';

// Initialize client (API design subject to change)
const client = new ComputeNet({
  network: 'testnet',
  endpoint: process.env.COMPUTENET_ENDPOINT
});

// Submit a compute job
const job = await client.submit({
  runtime: 'wasm',
  module: myWasmModule,
  inputs: { value: 42 },
  verification: 'full'
});

// Wait for verified result
const result = await job.waitForCompletion();

// Access the compute receipt
console.log('Receipt ID:', result.receipt.id);
console.log('Output:', result.output);
console.log('Verified:', result.verified);

Next Steps

Continue to learn about submitting jobs, verifying results, and testing your integrations.