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

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

ERPC को अपने Monad RPC endpoint के रूप में HTTP JSON-RPC requests के लिए इस्तेमाल करें। Monad RPC हमारे Global Edge Blockchain Infrastructure के भीतर ERPC के RPC APIs का हिस्सा है, और API key को ERPC Web Dashboard से मैनेज किया जा सकता है।
आप वही RPC key इस्तेमाल कर सकते हैं जो Solana, Ethereum और Avalanche के लिए इस्तेमाल होती है।
अपनी API key api-key query parameter में दें, या उसे Authorization: Bearer <YOUR_API_KEY> के रूप में भेजें। दोनों मौजूद होने पर query parameter का इस्तेमाल होता है।

Endpoints

JSON-RPC 2.0 requests को HTTP POST के रूप में यहाँ भेजें:
text
https://edge.erpc.global/monad?api-key=<YOUR_API_KEY>
या dedicated host पर:
text
https://monad.erpc.global?api-key=<YOUR_API_KEY>
Requests केवल / पर स्वीकार किए जाते हैं।

उदाहरण

यह रहा query parameter में API key के साथ एक HTTP request का उदाहरण।
bash
curl 'https://edge.erpc.global/monad?api-key=<YOUR_API_KEY>' --header 'Content-Type: application/json' --data '{
  "jsonrpc":"2.0","id":1,
  "method":"eth_blockNumber"
}'
यह रहा वही request, जिसमें API key Authorization header में है।
bash
curl 'https://edge.erpc.global/monad' --header 'Content-Type: application/json' --header 'Authorization: Bearer <YOUR_API_KEY>' --data '{
  "jsonrpc":"2.0","id":1,
  "method":"eth_blockNumber"
}'
आप अपनी API key ERPC Web Dashboard पर प्राप्त और verify कर सकते हैं: ERPC Web Dashboard

Batch Requests

प्रति HTTP request 1 से 100 calls वाले JSON-RPC batches समर्थित हैं। हर call का अपना id होना चाहिए, और एक batch के भीतर id values दोहराई नहीं जानी चाहिए। batch में हर call को अपने खुद के call के रूप में मीटर किया जाता है। Request body अधिकतम 1 MiB हो सकती है।

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

उपयोग को tokens में मीटर किया जाता है, और token दर method के अनुसार अलग हो सकती है। HTTP batch में हर call को अलग-अलग मीटर किया जाता है।

Free plan की सीमाएँ

Free plan पर, आपका account हर 10 सेकंड में एक request भेज सकता है। यह सीमा endpoint के अनुसार नहीं, बल्कि account के अनुसार गिनी जाती है, इसलिए किसी दूसरी chain को भेजा गया request भी इसमें गिना जा सकता है। इससे जल्दी भेजे गए request का जवाब HTTP 429 से दिया जाता है, और retry-after header प्रतीक्षा का समय सेकंड में बताता है।
Free plan पर, दो या अधिक JSON-RPC calls वाले request का जवाब HTTP 429 से दिया जाता है, और उसकी कोई भी call नहीं भेजी जाती: हर call को code -32041 वाली JSON-RPC error मिलती है। इसके बजाय इन calls को एक-एक करके भेजें।

समर्थित Methods

यह endpoint namespace के अनुसार समूहित ये 34 methods serve करता है।
  • web3_* (2): web3_clientVersion, web3_sha3
  • txpool_* (3): txpool_content, txpool_inspect, txpool_status
  • eth_* (24): eth_blockNumber, eth_call, eth_chainId, eth_estimateGas, eth_feeHistory, eth_gasPrice, eth_getBalance, eth_getBlockByHash, eth_getBlockByNumber, eth_getBlockReceipts, eth_getBlockTransactionCountByHash, eth_getBlockTransactionCountByNumber, eth_getCode, eth_getLogs, eth_getProof, eth_getStorageAt, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, eth_getTransactionByHash, eth_getTransactionCount, eth_getTransactionReceipt, eth_maxPriorityFeePerGas, eth_sendRawTransaction, eth_syncing
  • debug_* (4): debug_traceBlockByHash, debug_traceBlockByNumber, debug_traceCall, debug_traceTransaction
  • net_* (1): net_version
जो method या path सूची में नहीं है, उसका जवाब HTTP 400 से दिया जाता है।

Response Status Codes

HTTP statusअर्थ
200Upstream JSON-RPC response। JSON-RPC error भी HTTP 200 के साथ लौटाया जाता है: उसमें request का id और error.code बने रहते हैं, उसका error.message ERPC upstream error होता है, और error.data नहीं लौटाया जाता।
400समर्थित Methods सूची से बाहर का method या path, अमान्य JSON-RPC request, खाली batch या 100 से अधिक calls वाला batch, batch में duplicate id, या 1 MiB से बड़ी body।
401API key गुम या अमान्य है, या key पर लगी IP या Origin पाबंदी पूरी नहीं होती।
405POST के अलावा कोई अन्य request method।
426WebSocket Upgrade का अनुरोध किया गया। यह endpoint केवल HTTP पर काम करता है।
429Rate limited, जिसमें ऊपर बताई गई Free plan की सीमाएँ भी शामिल हैं: हर 10 सेकंड में एक से अधिक request, या एक request में दो या अधिक calls। अगर retry-after header मौजूद है, तो उतने seconds प्रतीक्षा करें।
502Upstream request पूरा नहीं हो सका: upstream response विफल रहा, response 8 MiB से बड़ा था, या 30 seconds के भीतर कोई जवाब नहीं मिला।
503Service अस्थायी रूप से अनुपलब्ध है।

Monad RPC Methods और Documentation

Standard methods, parameters और specifications की पूरी सूची के लिए official documentation देखें।