> For the complete documentation index, see [llms.txt](https://ellcrys.gitbook.io/ellcrys/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ellcrys.gitbook.io/ellcrys/api/miner-api.md).

# Miner

## miner\_start

Start the CPU miner.&#x20;

{% hint style="info" %}
**Private**: Requires authentication.
{% endhint %}

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_start", "id":21}'
```

#### Console Example

```javascript
> miner.start()
```

#### Returns:

`Boolean`&#x20;

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": true
}
```

## miner\_stop

Stop the CPU miner.

{% hint style="info" %}
**Private**: Requires authentication.&#x20;
{% endhint %}

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_stop", "id":21}'
```

#### Console Example

```javascript
> miner.stop()
```

#### Returns:

`Boolean`&#x20;

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": true
}
```

## miner\_stop

Stop the CPU miner.&#x20;

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_stop", "id":21}'
```

#### Console Example

```javascript
> miner.stop()
```

#### Returns:

`Boolean`&#x20;

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": true
}
```

## miner\_isMining

Checks whether the CPU miner is running.&#x20;

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_isMining", "id":21}'
```

#### Console Example

```javascript
> miner.isMining()
```

#### Returns:

`Boolean`&#x20;

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": true
}
```

## miner\_setThreads

Set the number of miner threads. By default, it is set to the number of available CPUs on the machine.

{% hint style="info" %}
**Private**: Requires authentication.&#x20;
{% endhint %}

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setThreads", "id":21}'
```

#### Console Example

```javascript
> miner.setThreads(3)
```

#### Returns:

`Boolean`&#x20;

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": true
}
```

## miner\_getHashrate

Get the hashrate.&#x20;

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_getHashrate", "id":21}'
```

#### Console Example

```javascript
> miner.getHashrate()
```

#### Returns:

`Integer`&#x20;

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": 1000
}
```
