/Docs/Network/RPC Endpoints

RPC Endpoints

Ramestta provides multiple RPC (Remote Procedure Call) endpoints for interacting with the blockchain. These endpoints support standard Ethereum JSON-RPC methods and are compatible with all major web3 libraries.

Mainnet Endpoints

HTTP Endpoints

EndpointURLStatus
Primaryhttps://blockchain.ramestta.com✅ Active
Secondaryhttps://blockchain2.ramestta.com✅ Active

WebSocket Endpoints

EndpointURLUse Case
Primary WSwss://blockchain.ramestta.com/wsReal-time subscriptions

Testnet Endpoints

TypeURL
HTTP RPChttps://testnet.ramestta.com
WebSocketwss://testnet.ramestta.com/ws
Block Explorerhttps://pingaksha.ramascan.com
Backend APIhttps://testbackendapi.ramascan.com
Faucethttps://testnet-faucet.ramascan.com

Making RPC Calls

Using cURL

curl-example.shbash
# Get current block number
curl -X POST https://blockchain.ramestta.com \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

# Response: {"jsonrpc":"2.0","id":1,"result":"0x1a2b3c"}

Batch Requests

For efficiency, you can batch multiple RPC calls into a single HTTP request:

batch-request.tstypescript
// Batch multiple requests for efficiency
const batchRequests = async () => {
  const response = await fetch('https://blockchain.ramestta.com', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify([
      { jsonrpc: '2.0', method: 'eth_blockNumber', params: [], id: 1 },
      { jsonrpc: '2.0', method: 'eth_gasPrice', params: [], id: 2 },
      { jsonrpc: '2.0', method: 'eth_chainId', params: [], id: 3 },
    ])
  });
  
  const results = await response.json();
  return results;
};

WebSocket Subscriptions

Use WebSocket connections for real-time updates:

websocket.tstypescript
import { ethers } from 'ethers';

// Connect via WebSocket
const wsProvider = new ethers.WebSocketProvider('wss://blockchain.ramestta.com/ws');

// Subscribe to new blocks
wsProvider.on('block', (blockNumber) => {
  console.log('New block:', blockNumber);
});

// Subscribe to pending transactions
wsProvider.on('pending', (txHash) => {
  console.log('Pending TX:', txHash);
});

// Subscribe to specific address
const address = '0x742d35Cc6634C0532925a3b844Bc9e7595f...';
wsProvider.on({ address }, (log) => {
  console.log('Address activity:', log);
});

High Availability Setup

For production applications, implement fallback providers:

fallback-provider.tstypescript
import { ethers } from 'ethers';

// Create provider with automatic fallback
const createFallbackProvider = () => {
  const providers = [
    new ethers.JsonRpcProvider('https://blockchain.ramestta.com'),
    new ethers.JsonRpcProvider('https://blockchain2.ramestta.com'),
  ];
  
  // FallbackProvider automatically switches on failure
  return new ethers.FallbackProvider(providers, 1370);
};

// Usage
const provider = createFallbackProvider();
const balance = await provider.getBalance(address);
â„šī¸Best Practice
Always implement retry logic and fallback endpoints in production applications. Network issues can occur, and having backup endpoints ensures your dApp remains functional.

API Key Authentication

If using a premium RPC service that requires authentication:

authenticated-rpc.tstypescript
// Add custom headers for API key authentication (if required)
const provider = new ethers.JsonRpcProvider({
  url: 'https://blockchain.ramestta.com',
  headers: {
    'X-API-Key': 'your-api-key',
  }
});

// Or with fetch for more control
const rpcCall = async (method: string, params: any[] = []) => {
  const response = await fetch('https://blockchain.ramestta.com', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': 'your-api-key',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method,
      params,
      id: Date.now(),
    })
  });
  
  const data = await response.json();
  if (data.error) throw new Error(data.error.message);
  return data.result;
};

Supported Methods

Ramestta RPC endpoints support all standard Ethereum JSON-RPC methods:

Chain Methods

MethodDescription
eth_chainIdReturns the chain ID
eth_blockNumberReturns current block number
eth_gasPriceReturns current gas price
eth_feeHistoryReturns historical gas data
net_versionReturns network ID

Account Methods

MethodDescription
eth_getBalanceReturns account balance
eth_getCodeReturns contract code
eth_getTransactionCountReturns nonce
eth_getStorageAtReturns storage value

Transaction Methods

MethodDescription
eth_sendRawTransactionSubmit signed transaction
eth_getTransactionByHashGet transaction by hash
eth_getTransactionReceiptGet transaction receipt
eth_estimateGasEstimate gas for transaction
eth_callExecute contract call (read-only)

Block Methods

MethodDescription
eth_getBlockByNumberGet block by number
eth_getBlockByHashGet block by hash
eth_getBlockTransactionCountByNumberTransaction count in block

Log Methods

MethodDescription
eth_getLogsGet logs matching filter
eth_newFilterCreate new log filter
eth_getFilterChangesPoll filter for changes
eth_uninstallFilterRemove filter

Rate Limits

âš ī¸Rate Limiting
Public endpoints may have rate limits during high traffic. For high-volume applications, consider running your own node or using a premium RPC service.
Endpoint TypeRate Limit
Public HTTP100 requests/second
Public WebSocket50 subscriptions
PremiumUnlimited

Troubleshooting

  • Connection refused: Check your internet connection and firewall settings
  • Rate limited: Implement exponential backoff or use multiple endpoints
  • Invalid response: Verify the RPC method and parameters are correct
  • Timeout: Increase timeout settings or try a different endpoint

Found an issue with this page? Report on GitHub