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
| Endpoint | URL | Status |
|---|---|---|
| Primary | https://blockchain.ramestta.com | â Active |
| Secondary | https://blockchain2.ramestta.com | â Active |
WebSocket Endpoints
| Endpoint | URL | Use Case |
|---|---|---|
| Primary WS | wss://blockchain.ramestta.com/ws | Real-time subscriptions |
Testnet Endpoints
| Type | URL |
|---|---|
| HTTP RPC | https://testnet.ramestta.com |
| WebSocket | wss://testnet.ramestta.com/ws |
| Block Explorer | https://pingaksha.ramascan.com |
| Backend API | https://testbackendapi.ramascan.com |
| Faucet | https://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
| Method | Description |
|---|---|
| eth_chainId | Returns the chain ID |
| eth_blockNumber | Returns current block number |
| eth_gasPrice | Returns current gas price |
| eth_feeHistory | Returns historical gas data |
| net_version | Returns network ID |
Account Methods
| Method | Description |
|---|---|
| eth_getBalance | Returns account balance |
| eth_getCode | Returns contract code |
| eth_getTransactionCount | Returns nonce |
| eth_getStorageAt | Returns storage value |
Transaction Methods
| Method | Description |
|---|---|
| eth_sendRawTransaction | Submit signed transaction |
| eth_getTransactionByHash | Get transaction by hash |
| eth_getTransactionReceipt | Get transaction receipt |
| eth_estimateGas | Estimate gas for transaction |
| eth_call | Execute contract call (read-only) |
Block Methods
| Method | Description |
|---|---|
| eth_getBlockByNumber | Get block by number |
| eth_getBlockByHash | Get block by hash |
| eth_getBlockTransactionCountByNumber | Transaction count in block |
Log Methods
| Method | Description |
|---|---|
| eth_getLogs | Get logs matching filter |
| eth_newFilter | Create new log filter |
| eth_getFilterChanges | Poll filter for changes |
| eth_uninstallFilter | Remove 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 Type | Rate Limit |
|---|---|
| Public HTTP | 100 requests/second |
| Public WebSocket | 50 subscriptions |
| Premium | Unlimited |
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