Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CLI option and API methods for min priority fee #1452

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Contributor

@mjsmike62 mjsmike62 Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The" article is not needed.

Usually, inanimate objects don't take a possessive.

* 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.
alexandratran marked this conversation as resolved.
Show resolved Hide resolved
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
alexandratran marked this conversation as resolved.
Show resolved Hide resolved

<!--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.
alexandratran marked this conversation as resolved.
Show resolved Hide resolved
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.
alexandratran marked this conversation as resolved.
Show resolved Hide resolved
For a running node, use:
* [`miner_getMinPriorityFee`](../api/index.md#minergetminpriorityfee) to get the value
alexandratran marked this conversation as resolved.
Show resolved Hide resolved
* [`miner_setMinPriorityFee`](../api/index.md#minersetminpriorityfee) to change the value.

### `nat-method`

<!--tabs-->
Expand Down