eth_getWork
Returns the hash of the current block, the seedHash, and the boundary condition to be met ("target").

REQUEST

1
POST https://<network>.infura.io/v3/YOUR-PROJECT-ID
Copied!

HEADERS

1
Content-Type: application/json
Copied!

EXAMPLE

1
## JSON-RPC over HTTPS POST
2
## Replace YOUR-PROJECT-ID with a Project ID from your Infura Dashboard
3
## You can also replace mainnet with a different supported network
4
curl https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
5
-X POST \
6
-H "Content-Type: application/json" \
7
-d '{"jsonrpc":"2.0","method":"eth_getWork","params": [],"id":1}'
8
9
## JSON-RPC over WSS
10
## Replace YOUR-PROJECT-ID with a Project ID from your Infura Dashboard
11
## You can also replace mainnet with a different supported network
12
wscat -c wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID
13
>{"jsonrpc":"2.0","method":"eth_getWork","params": [],"id":1}
Copied!

RESPONSE

RESULT FIELDS

  • WORK ARRAY
    • 32 Bytes - current block header pow-hash
    • 32 Bytes - the seed hash used for the DAG.
    • 32 Bytes - the boundary condition ("target"), 2^256 / difficulty.

BODY

NOTE: While Infura will allow this method, eth_getWork will never actually return mining work.
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"error": {
5
"code": -32000,
6
"message": "no mining work available yet"
7
}
8
}
Copied!
Copy link