# getmininginfo - Zcash

> Example code for the getmininginfo JSON-RPC method. Complete guide on how to use the getmininginfo JSON-RPC method in GetBlock.io Web3 documentation.

This method returns current mining-related state: block height, difficulty, transactions in the current block being built, and network hashes-per-second estimate. Useful for mining dashboards and pool operators tracking network conditions.

## Parameters

This method takes no parameters.

## Request

#### cURL

```bash
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getmininginfo",
    "params": [],
    "id": "getblock.io"
}'
```

#### Axios

#### example.js

```javascript
const axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'getmininginfo',
    params: [],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);
```

#### Request

#### example.py

```python
import requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'getmininginfo',
        'params': [],
        'id': 'getblock.io'
    }
)

print(response.json())
```

#### Rust

#### example.rs

```rust
use reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "getmininginfo",
            "params": [],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;
    
    println!("Result: {}", response["result"]);
    Ok(())
}
```

## Response

```json
{
    "jsonrpc": "2.0",
    "result": {
        "blocks": 3487829,
        "currentblocksize": 203589,
        "currentblocktx": 29,
        "networksolps": 31709653247,
        "networkhashps": 31709653247,
        "chain": "main",
        "testnet": false
    },
    "id": "getblock.io"
}
```

## Response Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `blocks` | integer | Current chain tip height |
| `currentblocksize` | integer | Size of the current block being built by the miner (bytes) |
| `currentblocktx` | integer | Transaction count in the current block being built |
| `networksolps` | number | Estimated network Equihash solutions per second |
| `networkhashps` | number | Same as `networksolps` (for Bitcoin-family compatibility) |
| `testnet` | boolean | `true` if serving Testnet |
| `chain` | string | Chain name (`main` or `test`) |

## Use Cases

* **Mining Pool Dashboards**: Display current network hashrate, difficulty, and mempool state
* **Miner Configuration Sanity Checks**: Verify node reports correct chain and testnet state
* **Network Statistics**: Feed hashrate estimates into chain-analytics dashboards

## Error Handling

| Error Code | Message | Description |
| --- | --- | --- |
| -32603 | Internal error | Node failed to compile mining state |
