Skip to main content
Time to read: 1 min

dRPC

dRPC is a next-generation RPC platform that simplifies and optimizes communication with blockchain nodes. Built for Web3, dRPC provides low-latency, high-reliability access to blockchain data and operations.

Why Choose dRPC?​

  • High Performance: Optimized for speed and low latency.
  • Decentralized: Built for scalability and resilience.
  • Cross-Blockchain Support: Interact with multiple blockchain ecosystems.

Supported Blockchains​

dRPC supports various blockchain networks, including:

  • Ethereum
  • Binance Smart Chain
  • Polygon
  • Solana
  • Avalanche

Protocols​

  • JSON-RPC
  • REST
  • WebSocket

Getting Started with dRPC API​

Sign Up and Get an API Key

  • Create an account on dRPC.io.
  • Generate your API key from the dashboard.

Configure Your Endpoint

Use the base URL for the desired blockchain network:

  • Ethereum Mainnet:
https://eth-mainnet.drpc.io/YOUR_API_KEY
  • Binance Smart Chain Testnet:
https://bsc-testnet.drpc.io/YOUR_API_KEY

Example API Call

Here’s a sample request to fetch the latest block number on Ethereum:

{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}

Make Your First Call​

Open an API client like Postman or curl

This will enable you test your API

Use the Ethereum Mainnet endpoint as an example:

https://eth-mainnet.drpc.io/YOUR_API_KEY

Send the following JSON-RPC request:

{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0xYourEthereumAddress", "latest"],
"id": 1
}

You’ll receive a response like this:

{
"jsonrpc": "2.0",
"result": "0x0234c8a3397aab58",
"id": 1
}

The result field contains the balance in Wei (smallest Ether unit).

Info

To learn more about the dRPC connection with Rootstock, including code snippets, RPC endpoints, and a step-by-step guide on adding Rootstock Mainnet to MetaMask using dRPC, click the button below:

Rootstock dRPC Website

Advanced Features​

Batch Requests​

Efficiently send multiple queries in a single request:

[
{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 },
{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xYourAddress", "latest"], "id": 2 }
]

WebSocket Subscriptions​

Subscribe to live events like new blocks or logs:

{
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": ["newHeads"],
"id": 1
}

REST Endpoints​

For developers preferring REST over JSON-RPC, dRPC offers RESTful APIs for common operations:

GET https://eth-mainnet.drpc.io/v1/account/0xYourEthereumAddress/balance
Last updated on by Owanate Amachree