go-ethereum

skip to content

miner Namespace

Last edited on November 9, 2026

The miner API changes the settings this node uses when building blocks. The methods that controlled proof-of-work mining (miner_getHashrate, miner_setEtherbase, miner_setRecommitInterval, miner_start and miner_stop) have been removed.

miner_setExtra

Sets the extra data to include in blocks built by this node. This is capped at 32 bytes.

ClientMethod invocation
Gominer.SetExtra(extra string) (bool, error)
Consoleminer.setExtra(string)
RPC{"method": "miner_setExtra", "params": [string]}

miner_setGasPrice

Sets the minimum gas tip accepted by the transaction pool and the block builder. Over RPC the value is a hex string such as "0x1"; a JSON number is rejected.

ClientMethod invocation
Gominer.SetGasPrice(gasPrice hexutil.Big) bool
Consoleminer.setGasPrice(number)
RPC{"method": "miner_setGasPrice", "params": [number]}

miner_setGasLimit

Sets the gas limit the node will target when building blocks. 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. Over RPC the value is a hex string such as "0x1c9c380"; a JSON number is rejected.

ClientMethod invocation
Gominer.SetGasLimit(gasLimit hexutil.Uint64) bool
Consoleminer.setGasLimit(number)
RPC{"method": "miner_setGasLimit", "params": [number]}

DOWNLOADS

© 2013–2026. The go-ethereum Authors | Do-not-Track