Marketplace has launched, further enabling blockchain developers! Learn more

Contents

eth_mining RPC method

The eth_mining EVM method is only supported on the Avalanche C-Chain.

Parameters:

  1. None

Returns:

  1. Result - Boolean true if the node is mining, otherwise false.

Code Examples:

To use the eth_mining EVM method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.

const ethers = require("ethers");
(async () => {
  const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/");
  const isMining = await provider.send("eth_mining");
  console.log(isMining);
})();
Ready to get started? Create a free account