FortiBlox LogoFortiBlox Docs
NexusRPC NodesRPC Guides

RPC Guides Overview

Comprehensive guides for using X1 Blockchain RPC methods organized by use case

RPC Guides Overview

These guides organize X1 Blockchain RPC methods by use case, providing comprehensive examples and best practices for common blockchain operations.

Available Guides

Guide Features

Each guide includes:

  • Method Overview - When and why to use each method
  • Multi-language Examples - JavaScript, Python, and cURL examples
  • Performance Tips - Credit costs and optimization strategies
  • Best Practices - Common patterns and anti-patterns
  • Real-world Use Cases - Complete working examples
  • Error Handling - How to handle failures gracefully

Quick Start

New to X1 Blockchain RPC? Start with these guides:

  1. Start with Current State Queries - Learn to read blockchain data
  2. Move to Transaction Submission - Learn to write to the blockchain
  3. Explore Historical Data - Query past transactions
  4. Check Network Information - Monitor cluster health
  5. Use Utility Methods - Helper functions for common tasks

Example: Building a Complete Application

Here's how these guides work together in a real application:

// 1. Current State - Check balance before transaction
const balance = await connection.getBalance(wallet.publicKey);

// 2. Utility Methods - Get rent costs and blockhash
const rentCost = await connection.getMinimumBalanceForRentExemption(165);
const { blockhash } = await connection.getLatestBlockhash();

// 3. Transaction Submission - Build and send transaction
const transaction = new Transaction().add(/* instructions */);
transaction.recentBlockhash = blockhash;
const signature = await connection.sendTransaction(transaction, [wallet]);

// 4. Historical Data - Verify transaction
await connection.confirmTransaction(signature);
const txDetails = await connection.getTransaction(signature);

// 5. Network Info - Monitor health
const health = await connection.getHealth();
const epoch = await connection.getEpochInfo();

Need Help?

Credit Costs Summary

Understanding credit costs helps you optimize your application:

Method TypeCreditsExamples
Simple Reads1getBalance, getHealth, getSlot
Account Queries1-3getAccountInfo (1), getMultipleAccounts (3)
Heavy Queries5getBlock, getTransaction, getProgramAccounts
Transactions10sendTransaction, simulateTransaction

Pro Tip: Use the guides' performance tips sections to minimize credit usage while maximizing application performance.