# This client's own hashrate

`GET /stats/mining/workers` · Lithos client API · Statistics

Source: https://lithosprotocol.org/docs/api/get-local-mining-summary

What the workers connected to this client are doing, as rates and totals across every
worker together. Narrower than `/stats/local`: no session identifiers, no fraud targets and
no per-worker breakdown, so it carries nothing the Stratum connection count does not.

Each accepted share is credited the expected hashes behind the difficulty its job advertised.
With reduced reporting on, miners are sent `reductionMultiplier` times the served difficulty
(see `StratumDifficulty`), and each share they send carries that difficulty's work. At a
multiplier of 10000 that is the super-share threshold, so every share is a super share.
Either way the rates are in the same units as network difficulty and compare directly with
`/stats/mining/difficulty`.

`hashesPerSecond` is the rate over the last 15 minutes — show this as current hashrate.
`windowShares` is how many shares it rests on: fewer shares, noisier reading.
`sessionHashesPerSecond` averages the whole session instead, so it reads low if the workers
started after the client did.

`nisp` says whether the recent super shares make a NISP, and until which height.

Counters restart whenever the producer does, and `sessionStartedAt` is when that happened —
the totals here are not lifetime figures.

## Responses

### 200: Current rates and totals; empty of values until a producer reports.

`LocalMiningSummary`

- `status` (string, required, one of disabled, loading, ready, stale, stopped): Freshness of the underlying producer observation.
- `enabled` (boolean, required): Whether statistics collection is on at all.
- `sessionStartedAt` (integer · int64): When the share producer last started, in Unix milliseconds. Every total below is since then.
- `observedAt` (integer · int64): When these counters were last sampled, in Unix milliseconds.
- `hashesPerSecond` (string): Current hashrate: assigned work gained over the last 15 minutes, divided by that time. Zero when no share arrived in that span. Falls back to the session rate until a second sample exists, and is omitted before there is any work.
- `sessionHashesPerSecond` (string): Assigned work over the whole session. Reads low when workers joined after the client started. Omitted before there is any work or elapsed time.
- `windowMs` (integer · int64, required): The span `hashesPerSecond` was measured over. Zero when it fell back to the session rate.
- `windowShares` (integer · int64, required): Shares accepted inside that span. The estimate's noise shrinks with this count, so a handful of shares makes a jumpy reading.
- `acceptedShares` (integer · int64, required)
- `rejectedShares` (integer · int64, required): Every rejection code added together. See `rejections` for the split.
- `blockCandidates` (integer · int64, required): Accepted shares that also solved a block. A subset of `acceptedShares`.
- `superShares` (integer · int64, required): Accepted shares that met the super-share threshold on a job using collateral. These are the proofs a NISP is built from, so they are what earns a payout score.
- `superSharesPerHour` (number · double): Super shares averaged over the session. Absent until the session has elapsed time.
- `assignedWork` (string, required): An exact nonnegative integer as a decimal string. Parse it without going through a float.
- `solutionsAccepted` (integer · int64, required): Block solutions the node accepted. Acceptance is not chain confirmation.
- `solutionsRejected` (integer · int64, required)
- `reducedReporting` (boolean, required): True when miners are sent a difficulty raised by the stratum's reduction multiplier. The rates already account for it; expect fewer, larger samples and a noisier reading.
- `rejections` (map<string, string>, required): Count per rejection code, keyed as `rejected<code>`.
- `nisp` (NispStatus): Whether this client's recent super shares make a NISP. A NISP for a rollup starting at height P takes 10 super shares from heights P - `windowBlocks` through P, so one holds until the tenth-newest super share is `windowBlocks` behind. Counted from the NISP store at the committed score, so super shares from before a client restart are included. Absent while no Stratum job is being served.
  - `held` (boolean, required): Whether a NISP could be submitted for a rollup starting at `atHeight`.
  - `superSharesInWindow` (integer, required): Super shares inside the window, counted up to `required`.
  - `required` (integer, required): Super shares a NISP carries.
  - `windowBlocks` (integer, required): How many blocks back from a rollup's start its super shares may come from.
  - `atHeight` (integer, required): The height a rollup would start at now, which the window is measured from.
  - `validThroughHeight` (integer): The last rollup start height this NISP covers. Absent when none is held.
  - `blocksRemaining` (integer): Blocks from `atHeight` until `validThroughHeight`. Absent when none is held.
  - `source` (string, required, one of store, session): `store` when counted from the NISP store. `session` when the store could not be read or no score is known yet, so only super shares found since the client started are counted.

## Example request

```bash
curl -X GET "http://localhost:9000/stats/mining/workers"
```

## Example response

```json
{
  "status": "disabled",
  "enabled": true,
  "sessionStartedAt": 0,
  "observedAt": 0,
  "hashesPerSecond": "0",
  "sessionHashesPerSecond": "0",
  "windowMs": 0,
  "windowShares": 0,
  "acceptedShares": 0,
  "rejectedShares": 0,
  "blockCandidates": 0,
  "superShares": 0,
  "superSharesPerHour": 0,
  "assignedWork": "1000000000",
  "solutionsAccepted": 0,
  "solutionsRejected": 0,
  "reducedReporting": true,
  "rejections": {
    "key": "1000000000"
  },
  "nisp": {
    "held": true,
    "superSharesInWindow": 0,
    "required": 0,
    "windowBlocks": 0,
    "atHeight": 0,
    "validThroughHeight": 0,
    "blocksRemaining": 0,
    "source": "store"
  }
}
```
