Quickstart

Get from zero to your first Solana RPC call in under 5 minutes. No email signup, no subscription, no manual approval.

Prerequisites

1. Install the SDK

npm install @nodius/sdk

The SDK does not require a Solana client library at runtime. The examples below use @solana/web3.js for keypair generation:

npm install @solana/web3.js

Or with yarn/pnpm:

yarn add @nodius/sdk
pnpm add @nodius/sdk

Python:

pip install nodius

2. Create a Keypair

If you don't already have a keypair for your bot:

import { Keypair } from "@solana/web3.js";
import fs from "fs";

const keypair = Keypair.generate();
fs.writeFileSync(
  "bot-keypair.json",
  JSON.stringify(Array.from(keypair.secretKey))
);

console.log("Public key:", keypair.publicKey.toBase58());

Security: This keypair is your identity and controls your credits. Store the secret key securely. Consider using environment variables or a secrets manager in production.

3. Initialize the Client

import { NodiusClient } from "@nodius/sdk";
import { Keypair } from "@solana/web3.js";
import fs from "fs";

// Load your keypair
const secret = JSON.parse(fs.readFileSync("bot-keypair.json", "utf-8"));
const keypair = Keypair.fromSecretKey(Uint8Array.from(secret));

// Initialize the client
const rpc = new NodiusClient("https://rpc.nodius.xyz", { keypair });

4. Activate Your Account

const account = await rpc.activate();

console.log("Account activated!");
console.log("Deposit address:", account.deposit_address);
console.log("Credits per USDC:", account.credits_per_usdc);
console.log("Credits expire after seconds:", account.credit_expiry_seconds);

This registers your public key with the service via POST /account/activate. The call is idempotent โ€” safe to call if already registered.

5. Fund Your Account

Send USDC to the shared deposit wallet returned in step 4. The system identifies your account from the transaction sender.

USDC (SPL Token): - Send USDC to the deposit wallet address - 1 USDC = 10,000 credits - Unused credits expire after 10 days - The system identifies you by the sending wallet address

After sending, you can confirm your deposit:

await rpc.confirmDeposit("your_tx_signature_here");

Credits typically appear within 30 seconds of on-chain confirmation.

6. Make Your First RPC Call

// Get the current slot
const slot = await rpc.call("getSlot");
console.log("Current slot:", slot);

// Get a balance
const balance = await rpc.call("getBalance", [
  "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
]);
console.log("Balance:", balance.value, "lamports");

// Get account info
const accountInfo = await rpc.call("getAccountInfo", [
  "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
  { encoding: "base64" },
]);
console.log("Account info:", accountInfo);

7. Check Your Credits

Every response includes an X-Credits-Remaining header. You can also check programmatically:

const info = await rpc.getAccountInfo();
console.log("Credits remaining:", info.balance);
console.log("Total credits used:", info.total_consumed_credits);

If you prefer a browser onboarding flow, open site/dashboard.html from the deployed site. It uses the same wallet-signature auth as bots, can activate the account, shows the deposit address, confirms deposits, and can generate an optional API key.

Full Working Example

import { NodiusClient } from "@nodius/sdk";
import { Keypair } from "@solana/web3.js";
import fs from "fs";

async function main() {
  // Load or create keypair
  let keypair: Keypair;
  try {
    const secret = JSON.parse(fs.readFileSync("bot-keypair.json", "utf-8"));
    keypair = Keypair.fromSecretKey(Uint8Array.from(secret));
  } catch {
    keypair = Keypair.generate();
    fs.writeFileSync(
      "bot-keypair.json",
      JSON.stringify(Array.from(keypair.secretKey))
    );
    console.log("Created new keypair:", keypair.publicKey.toBase58());
  }

  // Initialize client
  const rpc = new NodiusClient("https://rpc.nodius.xyz", { keypair });

  // Activate account (idempotent โ€” safe to call if already exists)
  const account = await rpc.activate();
  console.log("Account ready. Balance:", account.balance);

  if (account.balance === 0) {
    console.log("\nFund your account to start making calls:");
    console.log("  Send USDC to:", account.deposit_address);
    return;
  }

  // Make calls
  const slot = await rpc.call("getSlot");
  console.log("Current slot:", slot);

  const blockHeight = await rpc.call("getBlockHeight");
  console.log("Block height:", blockHeight);

  const health = await rpc.call("getHealth");
  console.log("Node health:", health);

  // Check remaining credits
  const info = await rpc.getAccountInfo();
  console.log("Credits remaining:", info.balance);
}

main().catch(console.error);

Using Without the SDK

You can use Nodius with any HTTP client. See the Authentication guide for how to sign requests manually, and the API Reference for endpoint details.

# Quick test with curl (after obtaining a session token)
curl -X POST https://rpc.nodius.xyz/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getSlot"}'

The RPC endpoint also works at https://rpc.nodius.xyz/rpc.

Next Steps