> For the complete documentation index, see [llms.txt](https://developer.electroneum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.electroneum.com/etn-sc-client/interacting-with-etn-sc/json-rpc-namespaces/miner.md).

# miner

The miner API is responsible to provide remote control the node's mining operation and set various mining specific settings.

### miner\_getHashrate <a href="#miner-hashrate" id="miner-hashrate"></a>

Get hashrate in H/s (Hash operations per second).

| CLIENT  | METHOD INVOCATION                               |
| ------- | ----------------------------------------------- |
| Console | miner.getHashrate()                             |
| RPC     | {"method": "miner\_getHashrate", "params": \[]} |

### miner\_setExtra <a href="#miner-setextra" id="miner-setextra"></a>

Sets the extra data a miner can include when miner blocks. This is capped at 32 bytes.

| CLIENT  | METHOD INVOCATION                                  |
| ------- | -------------------------------------------------- |
| Go      | miner.setExtra(extra string) (bool, error)         |
| Console | miner.setExtra(string)                             |
| RPC     | {"method": "miner\_setExtra", "params": \[string]} |

### miner\_setGasPrice <a href="#miner-setgasprice" id="miner-setgasprice"></a>

Sets the minimal accepted gas price when mining transactions. Any transactions that are below this limit are excluded from the mining process.

| CLIENT  | METHOD INVOCATION                                     |
| ------- | ----------------------------------------------------- |
| Go      | miner.setGasPrice(number \*rpc.HexNumber) bool        |
| Console | miner.setGasPrice(number)                             |
| RPC     | {"method": "miner\_setGasPrice", "params": \[number]} |

### miner\_setRecommitInterval <a href="#miner-setrecommitinterval" id="miner-setrecommitinterval"></a>

Updates the interval for recomitting the miner sealing work.

| CLIENT  | METHOD INVOCATION                                             |
| ------- | ------------------------------------------------------------- |
| Console | miner.setRecommitInterval(interval int)                       |
| RPC     | {"method": "miner\_setRecommitInterval", "params": \[number]} |

### miner\_start <a href="#miner-start" id="miner-start"></a>

Start the CPU mining process.

| CLIENT  | METHOD INVOCATION                         |
| ------- | ----------------------------------------- |
| Go      | miner.Start() error                       |
| Console | miner.start()                             |
| RPC     | {"method": "miner\_start", "params": \[]} |

### miner\_stop <a href="#miner-stop" id="miner-stop"></a>

Stop the CPU mining operation.

| CLIENT  | METHOD INVOCATION                        |
| ------- | ---------------------------------------- |
| Go      | miner.Stop() bool                        |
| Console | miner.stop()                             |
| RPC     | {"method": "miner\_stop", "params": \[]} |

### miner\_setEtherbase <a href="#miner-setetherbase" id="miner-setetherbase"></a>

Sets the etherbase, where mining rewards will go.

| CLIENT  | METHOD INVOCATION                                       |
| ------- | ------------------------------------------------------- |
| Go      | miner.SetEtherbase(common.Address) bool                 |
| Console | miner.setEtherbase(address)                             |
| RPC     | {"method": "miner\_setEtherbase", "params": \[address]} |

### miner\_setGasLimit <a href="#miner-setgaslimit" id="miner-setgaslimit"></a>

Sets the gas limit the miner will target when mining. Note: on networks where EIP-1559 is activated, this should be set to twice the gas target (i.e. the effective gas used on average per block) to be.

| CLIENT  | METHOD INVOCATION                                     |
| ------- | ----------------------------------------------------- |
| Go      | miner.SetGasLimit(number \*rpc.HexNumber) bool        |
| Console | miner.SetGasLimit(number)                             |
| RPC     | {"method": "miner\_setGasLimit", "params": \[number]} |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.electroneum.com/etn-sc-client/interacting-with-etn-sc/json-rpc-namespaces/miner.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
