go-ethereum/docs/_rpc/ns-miner.md
Felix Lange 7416b05b81
[DOCS] massive documentation update (#20229)
This PR:

- reorganizes all documentation pages so they live in the right category
- removes lots of legacy docs
- contains many improvements to active documentation pages

Geth user documentation is now spread across five major categories:

- Install and Build: installation and compile instructions
- Using Geth: this is for pages about general geth usage.
- For dApp Developers: this is for programming guides and functionality specific
   to dapp development. All the dev guides for mobile framework and Go APIs live here.
- JSON-RPC APIs: this has its own section because there is now a sub-page for
   every name space. I have also added an overview text that explains how to set
   up the API servers.
- For Geth Developers: this is for geth contributors
2019-11-05 13:46:00 +01:00

73 lines
2.7 KiB
Markdown

---
title: miner Namespace
sort_key: C
---
The `miner` API allows you to remote control the node's mining operation and set various
mining specific settings.
* TOC
{:toc}
### miner_getHashrate
Get your hashrate in H/s (Hash operations per second).
| Client | Method invocation |
|:--------|-------------------------------------------------------------|
| Console | `miner.getHashrate()` |
| RPC | `{"method": "miner_getHashrate", "params": []}` |
### miner_setExtra
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
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_start
Start the CPU mining process with the given number of threads and generate a new DAG
if need be.
| Client | Method invocation |
|:--------|-----------------------------------------------------|
| Go | `miner.Start(threads *rpc.HexNumber) (bool, error)` |
| Console | `miner.start(number)` |
| RPC | `{"method": "miner_start", "params": [number]}` |
### miner_stop
Stop the CPU mining operation.
| Client | Method invocation |
|:--------|----------------------------------------------|
| Go | `miner.Stop() bool` |
| Console | `miner.stop()` |
| RPC | `{"method": "miner_stop", "params": []}` |
### miner_setEtherbase
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]}` |