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-sdkSDK Under Development
Public SDK packages are not yet available. The examples below show the planned API design.
Basic Usage
A typical workflow involves:
- Initialize the client with your configuration
- Prepare the compute job with inputs and runtime
- Submit the job to the network
- Wait for execution and verification
- 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.