getmininginfo - Bitcoin Cash
Example code for the getmininginfo JSON-RPC method. Complete guide on how to use the getmininginfo JSON-RPC method in the GetBlock Web3 documentation.
Parameters
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getmininginfo",
"params": [],
"id": "getblock.io"
}'const axios = require('axios');
const { data } = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0', method: 'getmininginfo', params: [], id: 'getblock.io'
});
console.log(data.result.difficulty, data.result.networkhashps);import requests
response = requests.post(
'https://go.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'getmininginfo',
'params': [],
'id': 'getblock.io'
}
)
print(response.json()['result'])Response
{
"error": null,
"id": "getblock.io",
"result": {
"blocks": 684634,
"chain": "main",
"currentblocksize": 1999960,
"currentblocktx": 6269,
"difficulty": 303698825886.4642,
"networkhashps": 2.333876557488516e+18,
"pooledtx": 6334
}
}Response Parameters
Parameter
Type
Description
Result Object
Field
Type
Description
Use Cases
Error Handling
Error Code
Message
Description
Was this helpful?