Skip to content

Commit

Permalink
Added CLI option and API methods for min priority fee
Browse files Browse the repository at this point in the history
Signed-off-by: madelinemurray <madeline.murray@consensys.net>
  • Loading branch information
MadelineMurray committed Nov 22, 2023
1 parent c7c2603 commit 325b4cd
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 1 deletion.
93 changes: 92 additions & 1 deletion docs/public-networks/reference/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5408,7 +5408,11 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":["
## `MINER` methods
The `MINER` API methods allow you to control the node’s mining operation.
The `MINER` API methods allow you to control:
* The node’s mining operation.
* Settings related to block creation.
:::note
Expand Down Expand Up @@ -5459,6 +5463,49 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_changeTargetGasLimit","par
<!--/tabs-->
### `miner_getMinPriorityFee`
Gets the minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The initial value is set using the [`--min-priority-fee`](../cli/options.md#min-priority-fee) command line option, or defaults to 0, if the command line option is not specified.
Use [`miner_setMinPriorityFee`](#minersetminpriorityfee) to change the current value of the fee.
#### Parameters
None
#### Returns
`result`: _string_ - Minimum priority fee per gas (in Wei) in hexadecimal
<!--tabs-->
# curl HTTP request
```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_getMinPriorityFee","params":[],"id":1}' http://127.0.0.1:8545
```
# wscat WS request
```json
{
"jsonrpc": "2.0",
"method": "miner_getMinPriorityFee",
"params": [],
"id": 1
}
```
# JSON result
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": 0x1
}
```
<!--/tabs-->
### `miner_setCoinbase`
Sets the coinbase, the address for the mining rewards.
Expand Down Expand Up @@ -5508,6 +5555,50 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setCoinbase","params":["0x
<!--/tabs-->
### `miner_setMinPriorityFee`
Sets the minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The initial value is set using the [`--min-priority-fee`](../cli/options.md#min-priority-fee) command line option, or defaults to 0, if the command line option is not specified.
Use [`miner_getMinPriorityFee`](#minergetminpriorityfee) to get the current value of the fee.
#### Parameters
`minPriorityFeePerGas`: _integer_ - Minimum priority fee per gas
#### Returns
`result`: _boolean_ - `true` when fee is set
<!--tabs-->
# curl HTTP request
```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setMinPriorityFee","params":[1],"id":1}' http://127.0.0.1:8545
```
# wscat WS request
```json
{
"jsonrpc": "2.0",
"method": "miner_setMinPriorityFee",
"params": [1],
"id": 1
}
```
# JSON result
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
```
<!--/tabs-->
### `miner_start`
Starts the mining process. To start mining, you must first specify a miner coinbase using the [`--miner-coinbase`](../cli/options.md#miner-coinbase) command line option or using [`miner_setCoinbase`](#miner_setcoinbase).
Expand Down
35 changes: 35 additions & 0 deletions docs/public-networks/reference/cli/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,41 @@ In a [free gas network](../../../private-networks/how-to/configure/free-gas.md),

:::

### `min-priority-fee`

<!--tabs-->

# Syntax

```bash
--min-priority-fee=<minPriorityFeePerGas>
```

# Example

```bash
--min-gas-price=7
```

# Environment variable

```bash
BESU_MIN_PRIORITY_FEE=7
```

# Configuration file

```bash
min-priority-fee=7
```

<!--/tabs-->

The minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The default is 0 Wei.
For a running node, use:
* [`miner_getMinPriorityFee`](../api/index.md#minergetminpriorityfee) to get the value
* [`miner_setMinPriorityFee`](../api/index.md#minersetminpriorityfee) to change the value.

### `nat-method`

<!--tabs-->
Expand Down

0 comments on commit 325b4cd

Please sign in to comment.