FortiBlox LogoFortiBlox Docs
NexusRPC Nodes

RPC Nodes

High-performance X1 Blockchain RPC endpoints for mainnet, devnet, and testnet

RPC Nodes

FortiBlox Nexus provides high-performance X1 Blockchain RPC nodes with intelligent load balancing, automatic failover, and comprehensive monitoring. Access mainnet, devnet, and testnet with a single API key.

Quick Start

const axios = require('axios');

const endpoint = 'https://nexus.fortiblox.com/rpc';
const apiKey = process.env.FORTIBLOX_API_KEY;

// Get account info
const response = await axios.post(endpoint, {
  jsonrpc: '2.0',
  id: 1,
  method: 'getAccountInfo',
  params: [publicKey.toString(), { encoding: 'base64' }]
}, {
  headers: { 'X-API-Key': apiKey }
});

const accountInfo = response.data.result;

Endpoint URLs

POST https://nexus.fortiblox.com/rpc
Header: X-API-Key: YOUR_API_KEY

Network Selection: Mainnet is the default network. To specify a different network, include it in your request params or configuration.

Recommended for:

  • Production applications
  • Real user transactions
  • Live data and analytics
POST https://nexus.fortiblox.com/rpc
Header: X-API-Key: YOUR_API_KEY

Note: Specify devnet in your SDK configuration or connection settings.

Recommended for:

  • Development and testing
  • Learning X1 Blockchain
  • Testing features before mainnet deployment
  • Free tokens from faucets
POST https://nexus.fortiblox.com/rpc
Header: X-API-Key: YOUR_API_KEY

Note: Specify testnet in your SDK configuration or connection settings.

Recommended for:

  • Validator testing
  • Performance testing
  • Network upgrade testing

Features

Intelligent Load Balancing

FortiBlox automatically routes your requests to the healthiest RPC endpoint in our pool.

// You make a request...
const slot = await connection.getSlot();

// Behind the scenes, FortiBlox:
// 1. Checks health scores of all endpoints
// 2. Selects the best endpoint using weighted random selection
// 3. Routes your request automatically
// 4. Updates health scores based on response time

Benefits:

  • Better reliability - Automatic failover to healthy nodes
  • Lower latency - Always use the fastest available node
  • No manual management - We handle endpoint selection
  • Transparent - Response headers show which endpoint was used

Automatic Failover

If an endpoint becomes unhealthy, traffic is automatically redistributed:

Endpoint A: 95% healthy → Gets 47.5% of traffic
Endpoint B: 85% healthy → Gets 42.5% of traffic
Endpoint C: 20% healthy → Gets 10% of traffic
Endpoint D: 0% healthy  → Gets 0% of traffic (excluded)

Health Monitoring

Every endpoint is continuously monitored:

  • Response time tracking - Slow endpoints get lower scores
  • Error rate monitoring - Failing endpoints are deprioritized
  • Periodic health checks - Every 30 seconds
  • Automatic recovery - Endpoints regain traffic as health improves

View endpoint health in real-time:

curl https://nexus.fortiblox.com/rpc/health \
  -H "X-API-Key: $FORTIBLOX_API_KEY"
{
  "success": true,
  "pool": {
    "total_endpoints": 5,
    "healthy_endpoints": 4,
    "enabled_endpoints": 5,
    "avg_health_score": 87.5
  }
}

Rate Limits

Rate limits vary by subscription tier:

TierRequests/SecondBurst Limit
Free1020
Developer50100
Business200400
Professional5001000
EnterpriseCustomCustom

Burst Limit: Short bursts up to 2x your rate limit are allowed to handle traffic spikes.

Rate Limit Headers

Every response includes rate limit information:

X-RateLimit-Limit: 50
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1699564800

Handling Rate Limits

// ✅ CORRECT - Implement exponential backoff
async function makeRequestWithRetry(method, params, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      const response = await connection[method](...params);
      return response;
    } catch (error) {
      if (error.message.includes('429') && i < maxRetries - 1) {
        // Exponential backoff: 1s, 2s, 4s
        const delay = Math.pow(2, i) * 1000;
        console.log(`Rate limited. Retrying in ${delay}ms...`);
        await new Promise(resolve => setTimeout(resolve, delay));
      } else {
        throw error;
      }
    }
  }
}

// Usage
const slot = await makeRequestWithRetry('getSlot', []);

Credit Usage

Different RPC methods consume different amounts of credits:

Standard Methods (1 credit)

Most read operations:

  • getAccountInfo
  • getBalance
  • getBlockHeight
  • getHealth
  • getSlot
  • getVersion
  • getLatestBlockhash

Heavy Methods (5 credits)

Resource-intensive operations:

  • getBlock
  • getBlocks
  • getTransaction
  • getSignaturesForAddress
  • getProgramAccounts
  • getTokenAccountsByOwner

Transaction Methods (10 credits)

Transaction submission:

  • sendTransaction
  • simulateTransaction

View detailed credit costs in your Dashboard Analytics

Response Headers

Every RPC response includes helpful metadata:

HTTP/1.1 200 OK
Content-Type: application/json
X-RPC-Endpoint: http://validator1.internal:8899
X-RPC-Latency-Ms: 42
X-Request-Id: 550e8400-e29b-41d4-a716-446655440000
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 49
X-RateLimit-Reset: 1699564800
  • X-RPC-Endpoint - Which backend node served your request
  • X-RPC-Latency-Ms - Total response time in milliseconds
  • X-Request-Id - Unique request ID for debugging
  • X-RateLimit-* - Rate limit information

Error Handling

Authentication Errors

{
  "success": false,
  "error": "Invalid API key",
  "error_code": "INVALID_API_KEY"
}

Common causes:

  • Missing API key
  • Invalid or revoked API key
  • API key not active

Access Control Errors

{
  "success": false,
  "error": "Request origin not in allowed domains list",
  "error_code": "DOMAIN_NOT_ALLOWED",
  "allowed_domains": ["https://myapp.com"]
}

Common causes:

  • Domain restrictions enabled but request from unauthorized domain
  • IP restrictions enabled but request from unauthorized IP
  • Network restrictions enabled but wrong network requested

Rate Limit Errors

{
  "success": false,
  "error": "Rate limit exceeded. Maximum 50 requests per second allowed.",
  "error_code": "RATE_LIMIT_EXCEEDED",
  "limit": 50,
  "retry_after": 1
}

Solution: Implement exponential backoff and respect the retry_after value.

Service Errors

{
  "success": false,
  "error": "No healthy RPC endpoints available. Please try again later.",
  "error_code": "NO_HEALTHY_ENDPOINTS"
}

Common causes:

  • All RPC endpoints are down (rare)
  • Network connectivity issues
  • Maintenance window

Check our Status Page for real-time service status.

Best Practices

1. Use Commitment Levels Appropriately

// For recent data (faster)
const connectionConfirmed = new Connection(url, 'confirmed');

// For finalized data (slower but safer)
const connectionFinalized = new Connection(url, 'finalized');
  • processed - Fastest, least safe (block not yet confirmed)
  • confirmed - Balanced (supermajority vote)
  • finalized - Slowest, safest (32+ confirmed blocks)

2. Implement Caching

// ✅ Cache data that doesn't change frequently
const cache = new Map();
const CACHE_TTL = 60000; // 1 minute

async function getAccountInfoCached(publicKey) {
  const cached = cache.get(publicKey.toString());
  if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
    return cached.data;
  }

  const data = await connection.getAccountInfo(publicKey);
  cache.set(publicKey.toString(), { data, timestamp: Date.now() });
  return data;
}

3. Batch Requests When Possible

// ❌ DON'T - Multiple individual requests
const balance1 = await connection.getBalance(pubkey1);
const balance2 = await connection.getBalance(pubkey2);
const balance3 = await connection.getBalance(pubkey3);

// ✅ DO - Use getMultipleAccounts
const accounts = await connection.getMultipleAccountsInfo([
  pubkey1, pubkey2, pubkey3
]);

4. Monitor Your Usage

Regularly check your dashboard for:

  • Credit consumption trends
  • Most expensive operations
  • Error rates by endpoint
  • Peak usage times

RPC Method Reference

Troubleshooting

Slow Response Times

  1. Check endpoint health: GET /rpc/health
  2. Verify your network connection
  3. Consider using confirmed instead of finalized commitment
  4. Check if you're hitting rate limits

Inconsistent Data

  1. Use same commitment level across related requests
  2. Account for slot progression between requests
  3. Consider using getLatestBlockhash to anchor requests

Connection Timeouts

Default timeout is 30 seconds. Increase if needed:

const connection = new Connection(url, {
  commitment: 'confirmed',
  httpHeaders: { 'timeout': '60000' } // 60 seconds
});

Additional Resources