अपने Unlimited Endpoint पर Ethereum को कॉल करें

Unlimited Endpoint आपका अपना डेडिकेटेड HTTP endpoint है, जो आपके चुने हुए region के server पर चलता है। Ethereum को कॉल करने के लिए इसके URL में /eth जोड़ें। Calls मीटर नहीं की जातीं, इसलिए आप कितनी calls भेजते हैं, इससे आपका भुगतान नहीं बदलता, और प्रति-request rate limit भी नहीं है।

Unlimited से आप क्या कर सकते हैं

  • ERPC टोकन खर्च किए बिना कॉल करें। Edge RPC हर call के लिए आपके ERPC टोकन balance से टोकन काटता है; इस endpoint पर की गई calls से balance में से कुछ नहीं कटता, और मासिक credit quota या burst throttling भी नहीं है।
  • RPC key के बिना connect करें। Endpoint उन IP addresses से requests लेता है जिन्हें आप register करते हैं।
  • नए connection पर पहला जवाब और जल्दी पाएँ। Endpoint सादा HTTP है, इसलिए TLS handshake का इंतज़ार नहीं करना पड़ता। HTTP और WebSocket एक ही port इस्तेमाल करते हैं।

Request भेजें

ERPC Web Dashboard में region और plan चुनकर Unlimited Endpoint लें, और requests भेजने वाले server का IP address register करें। Dashboard आपके endpoint को IP address और port 8899 वाले सादे HTTP URL के रूप में दिखाता है।
Ethereum requests को endpoint पर /eth जोड़कर भेजें:
endpoint
http://<YOUR_ENDPOINT_IP>:8899/eth
WebSocket भी उसी port पर है, /eth/ws पर:
endpoint
ws://<YOUR_ENDPOINT_IP>:8899/eth/ws
यह request Ethereum से उसका नवीनतम block number माँगता है:
bash
curl http://<YOUR_ENDPOINT_IP>:8899/eth \
  --header 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber"}'
Result, hexadecimal में block number होता है:
json
{ "jsonrpc": "2.0", "id": 1, "result": "0x..." }
नए blocks आते ही पाने के लिए WebSocket से connect करें और subscribe करें:
bash
wscat -c "ws://<YOUR_ENDPOINT_IP>:8899/eth/ws"
# After connected, send:
{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}

समर्थित Methods

Ethereum methods के लिए Edge RPC › Ethereum › एंडपॉइंट और RPC keys में समर्थित Methods देखें।

संबंधित पेज