Ethereum RPC endpoint दस्तावेज़ | ERPC

Ethereum RPC endpoint दस्तावेज़

ERPC को अपने Ethereum RPC endpoint के रूप में HTTP JSON-RPC requests और WebSocket subscriptions के लिए इस्तेमाल करें। Ethereum RPC हमारे Global Edge Blockchain Infrastructure के भीतर ERPC के RPC APIs का हिस्सा है, और API key को ERPC Web Dashboard से मैनेज किया जा सकता है।
आप वही RPC key इस्तेमाल कर सकते हैं जो Solana के लिए इस्तेमाल होती है।
कृपया अपनी API key को api-key parameter में जोड़ें।

Endpoints

JSON-RPC 2.0 requests को HTTP POST के रूप में यहाँ भेजें:
text
https://edge.erpc.global/eth?api-key=<YOUR_API_KEY>
Subscriptions के लिए, WebSocket पर यहाँ connect करें:
text
wss://edge.erpc.global/eth?api-key=<YOUR_API_KEY>

उदाहरण:

यह रहा एक HTTP request का उदाहरण।
bash
curl https://edge.erpc.global/eth?api-key=<YOUR_API_KEY> --header 'Content-Type: application/json' --data '{
  "jsonrpc":"2.0","id":1,
  "method":"eth_blockNumber"
}'
यह रहा एक WebSocket subscription का उदाहरण।
bash
wscat -c "wss://edge.erpc.global/eth?api-key=<YOUR_API_KEY>"
# After connected, send:
{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}
आप अपनी API key ERPC Web Dashboard पर प्राप्त और verify कर सकते हैं: ERPC Web Dashboard

Batch Requests

प्रति HTTP request 256 तक के JSON-RPC batches समर्थित हैं, और JSON-RPC notifications भी स्वीकार किए जाते हैं। batch में हर call को अपने खुद के call के रूप में मीटर किया जाता है।

उपयोग मीटरिंग

उपयोग को प्रति JSON-RPC call एक फ्लैट दर पर tokens में मीटर किया जाता है — हर Ethereum RPC method के लिए वही दर। HTTP batch में हर entry और WebSocket connection पर भेजा गया हर JSON-RPC call अलग-अलग मीटर किया जाता है। आप मौजूदा प्रति-call token दर Ethereum RPC API संदर्भ में देख सकते हैं।

समर्थित Methods

यह endpoint मानक Ethereum JSON-RPC method families को कवर करता है — eth_*, net_*, txpool_*, और web3_* — जिसमें account और block reads (eth_getBalance, eth_getBlockByNumber, eth_getLogs), transaction flow (eth_sendRawTransaction, eth_getTransactionReceipt), fee data (eth_feeHistory, eth_maxPriorityFeePerGas), call simulation (eth_call, eth_callMany, eth_simulateV1), state proofs (eth_getProof), filters (eth_newFilter, eth_getFilterChanges), txpool inspection (txpool_status, txpool_content), और WebSocket subscriptions (eth_subscribe, eth_unsubscribe) शामिल हैं।
Request और response shapes के साथ पूरी method सूची के लिए, Ethereum RPC API संदर्भ देखें।

Response Status Codes

HTTP statusअर्थ
200Upstream JSON-RPC response।
400अमान्य JSON-RPC request।
401गुम या unauthorized API key।
429Downstream RPC policy द्वारा rate limited।
502Proxy अनुपलब्ध।
503Downstream RPC service अनुपलब्ध।
WebSocket connections ऊपर दिए गए codes के अलावा 101 (protocol upgrade accepted) और 426 (WebSocket Upgrade handshake आवश्यक है) का इस्तेमाल करते हैं।

Ethereum RPC Methods और Documentation

Standard methods, parameters और subscription specifications की पूरी सूची के लिए official documentation देखें। इसमें HTTP और WebSocket दोनों का उपयोग शामिल है।