Docs
Supported ChainsLineaJSON-RPC APIMining Methods

eth_hashrate - Linea RPC Method

Get the legacy eth_hashrate compatibility value on Linea. Public endpoints may return `0x0` or an unsupported-method error depending on the client.

Returns the legacy eth_hashrate compatibility value on Linea. Depending on the client behind the endpoint, this call may return a hex quantity like 0x0 or a method-not-found style error.

Why Linea? Build on Consensys-backed zkEVM L2 with $1B+ TVL and 807% growth in 2025 with 15-30x lower fees than Ethereum mainnet, 6,200 TPS throughput, SWIFT integration with 12+ institutions, and $725M Consensys backing.

Note: Treat eth_hashrate as a node-local mining metric and compatibility value. Public endpoints often report 0x0 or 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 enterprise developers, DeFi builders, and teams seeking Consensys ecosystem integration:

  • 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

Request Parameters

Request

This method accepts no parameters.

Response Body

Response
resultQUANTITY

Hexadecimal string representing the reported compatibility value when the client exposes the method

Code Examples

Bash
curl -X POST https://api-linea-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_hashrate",
    "params": [],
    "id": 1
  }'

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:

JavaScript
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:

JavaScript
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 CodeDescriptionSolution
-32603Internal errorNode may be initializing — retry after delay
-32601Method not foundNode client may not support this method
-32005Rate limit exceededReduce polling frequency