eth_hashrate - Base RPC Method
Get the legacy eth_hashrate compatibility value on Base. Public endpoints may return `0x0` or an unsupported-method error depending on the client.
Returns the legacy eth_hashrate compatibility value on Base. Depending on the client behind the endpoint, this call may return a hex quantity like 0x0 or a method-not-found style error.
Why Base? Build on Coinbase's L2 with 54% of L2 market revenue and direct access to 110M+ Coinbase users with $8B+ TVL, $0.08 gas fees, built-in Coinbase distribution, and seamless fiat rails.
Note: Treat
eth_hashrateas a node-local mining metric and compatibility value. Public endpoints often report0x0or reject the method entirely, so it is not a reliable chain-health or consensus signal.
When to Use This Method
eth_hashrate is relevant for consumer app developers, SocialFi builders, and teams seeking easy fiat onramps:
- Node Diagnostics — Check whether the connected client reports a legacy hashrate metric
- Client Capability Checks — Distinguish between
0x0, unsupported-method, and method-not-found responses - Dashboard Integration — Display the metric alongside other node status data when it is available
Code Examples
Common Use Cases
1. Compatibility-Aware Status Dashboard
Display the reported compatibility value alongside other client status signals without assuming the method is always available:
async function getMiningStats(provider) {
const blockNumber = await provider.getBlockNumber();
let hashrate = null;
let supported = true;
try {
hashrate = await provider.send('eth_hashrate', []);
} catch (error) {
supported = false;
}
return {
supported,
hashrate: hashrate ? parseInt(hashrate, 16) : null,
currentBlock: blockNumber
};
}2. Capability Check
Check whether the connected client reports eth_hashrate at all:
async function getHashrateStatus(provider) {
try {
const hashrate = await provider.send('eth_hashrate', []);
return { supported: true, raw: hashrate, isZero: hashrate === '0x0' };
} catch (error) {
return { supported: false, message: error.message };
}
}
console.log(await getHashrateStatus(provider));Error Handling
Common errors and solutions:
| Error Code | Description | Solution |
|---|---|---|
| -32603 | Internal error | Node may be initializing — retry after delay |
| -32601 | Method not found | Node client may not support this method |
| -32005 | Rate limit exceeded | Reduce polling frequency |
Related Methods
eth_mining— Check if the node is actively miningeth_coinbase— Get the mining/coinbase addresseth_blockNumber— Get the current block height
eth_mining
Check the legacy eth_mining compatibility method on Base. Public endpoints often return a client-specific unsupported-method response instead of a boolean.
eth_coinbase
Check the legacy eth_coinbase compatibility method on Base. Public endpoints may return an address, `unimplemented`, or another unsupported-method response depending on the client.