R5 Network
WebsiteR5 LabsGitHub
  • Getting Started
    • Hello & Welcome!
  • About R5
    • Overview
    • R5 Components
    • Consensus Mechanism
    • zkNet (Privacy)
  • R5 Coin
  • R5 Tokenomics
  • Tutorials & Guides
    • Connect & Use R5
      • R5 Desktop Wallet
      • MetaMask
      • Rabby Wallet
      • Coinbase Wallet
    • zkNet Web Wallet
    • R5 Desktop Wallet
      • Interface Overview
      • Send a Transaction
      • Receive a Transaction
      • Backup Your Wallet
      • Retrieve Your Private Key
    • How To: Deploy a Node
    • How To: Mine R5
    • How To: GPU Mine R5
    • How To: Build R5 From Source
    • How To: Connect Local Nodes
  • For Developers
    • R5 SDK
      • R5 Relayer
      • R5 Console
      • JS Console
      • CLI Wallet
      • SCdev
      • SSL Proxy
    • Hardware Requirements
    • R5 Testnet
    • R5 Devnet
    • Local Networks
    • JSON-RPC API
      • admin
      • debug
      • ethash
      • miner
      • net
      • r5 (eth)
      • rpc
      • txpool
      • web3
    • Indexer API
    • zkNet API
    • Node Configuration
    • Ethash-R5
    • Smart Contracts
    • Wrapped R5 (Native)
    • Tokens & NFTs
  • Bug Bounty Program
  • Resources
    • Website
    • R5 Labs
    • R5 Labs GitHub
Powered by GitBook
On this page
  • ethash_getHashrate
  • ethash_getWork
  • ethash_submitHashrate
  1. For Developers
  2. JSON-RPC API

ethash

The ethash namespace provides endpoints for accessing and interacting with the Ethash PoW process. It includes methods to retrieve the current mining work package, check the current hashrate, and submit computed proofs-of-work. These endpoints are essential for miners and for monitoring mining performance.


ethash_getHashrate

Description: Returns the current mining hashrate as computed by the node, typically represented as a hexadecimal value (in hashes per second).

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "ethash_getHashrate",
  "params": [],
  "id": 1
}

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x12" // Example: 18 in decimal hashes per second
}

Parameters: None.


ethash_getWork

Description: Provides the current work package for miners. The returned array includes:

  1. The block header hash (used in the PoW computation)

  2. The seed hash for the current epoch (used for dataset generation)

  3. The target difficulty (the value that the computed hash must be below)

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "ethash_getWork",
  "params": [],
  "id": 1
}

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    "0xheaderhash...", 
    "0xseedhash...", 
    "0xtarget..."
  ]
}

Parameters: None.


ethash_submitHashrate

Description: Submits the miner’s computed hashrate to the node. This endpoint is used to report the miner's performance and may be used for monitoring or reward distribution purposes.

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "ethash_submitHashrate",
  "params": ["0x1a", "0xworkerID"],
  "id": 1
}

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": true
}

Parameters:

  • hashrate (string): The miner’s computed hashrate as a hexadecimal string. &#xNAN;Example: "0x1a" (which is 26 in decimal).

  • id (string): The worker identifier (typically a hexadecimal string). &#xNAN;Example: "0xworkerID".

PreviousdebugNextminer

Last updated 2 months ago