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).
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 WebsiteAdvanced 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