โ†
Previous Module
Wallet Connect Demo

๐Ÿ› ๏ธ Common Methods: eth_call vs eth_send

Master the most-used RPC methods for reading and writing data

Communicate with blockchain nodes programmatically

๐Ÿ”ง Common RPC Methods

Ethereum has 70+ RPC methods, but you'll use ~10-15 regularly. They fall into three categories: Read methods (query blockchain state, no gas), Write methods (submit transactions, costs gas), and Network methods (node info, network status). Let's explore the most important ones you'll use daily when building dApps.

๐ŸŽฎ Interactive: Method Category Browser

Select a category to explore common RPC methods. Click through each method to see parameters, return values, use cases, and real-world examples.

eth_getBalance

1 / 5
Parameters
โ€ข address
โ€ข block
Returns
Balance in wei (hex)
๐ŸŽฏ Use Case

Check wallet/contract ETH balance

Cost
Free (read-only)
Real Example
Wallet apps showing your balance

โšก Performance Tips

1๏ธโƒฃ
Batch Requests

Send multiple RPC calls in one HTTP request using JSON-RPC batch format. Reduces latency by 10-100x for multiple queries. Libraries like ethers.js support this via provider.send([...]).

2๏ธโƒฃ
Cache Immutable Data

Block data, transaction receipts, and historical logs never change. Cache them in your database or browser localStorage. Don't re-fetch the same block 1000 timesโ€”it's identical every time.

3๏ธโƒฃ
Use WebSockets for Real-time

For monitoring new blocks or pending transactions, use eth_subscribe via WebSocket instead of polling eth_blockNumber every second. Saves 99% of requests.

๐Ÿ’ก Key Insight

Most dApps use 5 methods 90% of the time: eth_call (read contract), eth_sendRawTransaction (write), eth_getBalance (check ETH), eth_getLogs (query events), and eth_blockNumber (current block). Master these five and you can build 95% of Web3 applications. The other 65 methods are for edge cases, debugging, or specialized tools.

โ† Introduction