Official TypeScript and JavaScript SDK for the RIGNODE decentralized compute exchange. Submit AI inference jobs, register nodes, and query network stats from your application.
npm install @rignode/sdkimport { RignodeClient } from "@rignode/sdk";
const client = new RignodeClient();
// Get network stats
const stats = await client.getNetworkStats();
console.log(`${stats.activeNodes} active nodes, $${stats.totalUsdcPaid} USDC paid`);
// Submit an inference job
const job = await client.submitJob({
model: "llama3-8b-q4",
prompt: "Explain decentralized compute in one paragraph.",
clientAddress: "YOUR_SOLANA_WALLET",
});
console.log("Job submitted:", job.id, job.status);const client = new RignodeClient({
baseUrl: "https://rignode.xyz/api", // optional, this is the default
fetch: customFetch, // optional, override the fetch implementation
});// List all registered nodes
const nodes = await client.listNodes();
// Get a specific node
const node = await client.getNode(42);
// Register a new node
const node = await client.registerNode({
walletAddress: "7xKXtg...",
gpuModel: "RTX 4090",
vram: 24,
region: "us-east",
});
// Update node status or speed
await client.updateNode(42, { status: "online", tokensPerSec: 120 });
// Send a heartbeat to keep node online
await client.heartbeat(42);
// List jobs assigned to a node
const jobs = await client.listNodeJobs(42);
// List earnings for a node
const earnings = await client.listNodeEarnings(42);// List all jobs
const jobs = await client.listJobs();
// Get a specific job
const job = await client.getJob(7);
// Submit a job (with optional USDC payment tx)
const job = await client.submitJob({
model: "llama3-8b-q4",
prompt: "Summarize this text: ...",
clientAddress: "YOUR_SOLANA_WALLET",
txSignature: "5Hn3...", // Solana tx signature after paying the quote
});// Get a price quote before paying
const quote = await client.getQuote("llama3-8b-q4", 500);
// quote.amountUsdc => amount to send in USDC
// quote.treasuryWallet => destination wallet
// quote.usdcMint => USDC token mint address
// quote.expiresAt => quote expires in 10 minutes// Network-wide stats
const stats = await client.getNetworkStats();
// Estimate earnings for a GPU
const estimate = await client.getProfitability({
gpuModel: "RTX 4090",
powerWatts: 350,
electricityRate: 0.12,
utilizationPct: 0.6,
});
console.log(`Monthly net: $${estimate.monthlyNetUsdc} USDC`);| Model | Price per 1K output tokens |
|---|---|
llama3-8b-q4 |
$0.0004 USDC |
llama3-70b-q4 |
$0.0016 USDC |
mistral-7b-q4 |
$0.0003 USDC |
qwen2-7b-q4 |
$0.0003 USDC |
whisper-large-v3 |
$0.0006 USDC |
RTX 3060 through RTX 5090, AMD RX 6000 and 7000 series, NVIDIA data center cards (A10, A100, H100), and Intel Arc. See the full list on the RIGNODE node registry.
us-east, us-west, eu-west, ap-southeast, sa-east
All types are exported from the package root:
import type {
Node, NodeInput,
Job, JobInput,
EarningRecord,
NetworkStats,
ProfitabilityEstimate,
QuoteResponse,
} from "@rignode/sdk";- Website: rignode.xyz
- Twitter: @Rignode
- GitHub: github.com/rignode
- CLI: rignode/rignode-cli
MIT