Digine-Labs / rosettanet

Ethereum <> Starknet RPC middleware.
MIT License
34 stars 26 forks source link

feat: Implement eth_getWork method #162

Closed Boreas09 closed 3 months ago

Boreas09 commented 3 months ago

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

Parameters :

None

Returns :

An array with the following properties:

Request :

curl https://mainnet.infura.io/v3/YOUR-API-KEY \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getWork","params": [],"id":1}'

Response :

While Infura will allow this method, eth_getWork will not actually return mining work.

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "no mining work available yet"
  }
}

DO NOT FORGET TO UPDATE methodsStatus.md (set this method as finished)

/rosettanet/docs/methodsStatus.md

methodsStatus.md