From 0a78a03d69cf8ec577f81fcf272ed72a3d9644a4 Mon Sep 17 00:00:00 2001 From: MadelineMurray <43356962+MadelineMurray@users.noreply.github.com> Date: Sun, 6 Jan 2019 10:52:17 +1100 Subject: [PATCH] Added eth_hashrate. (#503) Added eth_hashrate Signed-off-by: Adrian Sutton --- docs/Reference/JSON-RPC-API-Methods.md | 29 ++++++++++++++++++++++++++ docs/Using-Pantheon/Mining.md | 3 ++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/Reference/JSON-RPC-API-Methods.md b/docs/Reference/JSON-RPC-API-Methods.md index 78d969c3f2..277a672f29 100644 --- a/docs/Reference/JSON-RPC-API-Methods.md +++ b/docs/Reference/JSON-RPC-API-Methods.md @@ -374,6 +374,35 @@ None } ``` +### eth_hashrate + +Returns the number of hashes per second with which the node is mining. + +**Parameters** + +None + +**Returns** + +`result` : `quantity` - Number of hashes per second + +!!! example + ```bash tab="curl HTTP request" + $ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":1}' + ``` + + ```bash tab="wscat WS request" + {"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":1} + ``` + + ```json tab="JSON result" + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x12b" + } + ``` + ### eth_gasPrice Returns the current gas unit price in wei. diff --git a/docs/Using-Pantheon/Mining.md b/docs/Using-Pantheon/Mining.md index 2d5083b996..cfb065c93a 100644 --- a/docs/Using-Pantheon/Mining.md +++ b/docs/Using-Pantheon/Mining.md @@ -14,4 +14,5 @@ JSON-RPC API methods for mining are: * [`miner_start`](../Reference/JSON-RPC-API-Methods.md#miner_start) to start mining. * [`miner_stop`](../Reference/JSON-RPC-API-Methods.md#miner_stop) to stop mining. -* [`eth_mining`](../Reference/JSON-RPC-API-Methods.md#eth_mining) to determine whether the client is actively mining new blocks. \ No newline at end of file +* [`eth_mining`](../Reference/JSON-RPC-API-Methods.md#eth_mining) to determine whether the client is actively mining new blocks. +* [`eth_hashrate`](../Reference/JSON-RPC-API-Methods.md#eth_hashrate) to get the number of hashes per second with which the node is mining. \ No newline at end of file