Skip to content

Commit

Permalink
Merge branch 'main' into 1493-update-link
Browse files Browse the repository at this point in the history
  • Loading branch information
joaniefromtheblock authored Feb 1, 2024
2 parents 235d77f + 88d3dd4 commit cf242b8
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 238 deletions.
14 changes: 14 additions & 0 deletions docs/private-networks/how-to/configure/free-gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,17 @@ Update the `hardhat.config.js` file:
```js
gas: "0x1ffffffffffffe";
```

Setting `gasPrice` to `0` should cover transaction costs for most deployments.

1. Specify `evmVersion` when using the latest Solidity version.

```js
solidity: {
version: "0.8.20",
settings: {
evmVersion: "london", // required for Besu
optimizer: {...},
},
},
```
2 changes: 1 addition & 1 deletion docs/public-networks/how-to/connect/manage-peers.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Note, `Xp2p-peer-lower-bound` is an early access option.

## Limit remote connections

Prevent eclipse attacks when using [`--sync-mode`](../../reference/cli/options.md#sync-mode) and [`--fast-sync-min-peers`](../../reference/cli/options.md#fast-sync-min-peers) on public networks by enabling the [remote connection limits](../../reference/cli/options.md#remote-connections-limit-enabled).
Prevent eclipse attacks when using [`--sync-mode`](../../reference/cli/options.md#sync-mode) and [`--fast-sync-min-peers`](../../reference/cli/options.md##sync-min-peers-fast-sync-min-peers) on public networks by enabling the [remote connection limits](../../reference/cli/options.md#remote-connections-limit-enabled).

In private and permissioned networks with only trusted peers, enabling the remote connection limits is unnecessary and might adversely affect the speed at which nodes can join the network. Limiting remote connections can cause a closed group of peers to form when the number of nodes in the network is slightly higher than [`--max-peers`](../../reference/cli/options.md#max-peers). The nodes in this closed group are all connected to each other and can't accept more connections.

Expand Down
202 changes: 53 additions & 149 deletions docs/public-networks/how-to/monitor/metrics.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ tags:

# Trace transactions

:::caution Forest pruning deprecation notice

Forest pruning (using the [`--pruning-enabled`](../../reference/cli/options.md#pruning-enabled) option) is deprecated and will be removed in a future release. We recommend using [Bonsai Tries](../../concepts/data-storage-formats.md#bonsai-tries) as an alternative for saving disk space.

:::

To get detailed information about transaction processing, use the [`TRACE` API](../../reference/api/index.md#trace-methods). Enable the `TRACE` API using the [`--rpc-http-api`](../../reference/cli/options.md#rpc-http-api) or [`--rpc-ws-api`](../../reference/cli/options.md#rpc-ws-api) command line options.

The `TRACE` API has two sets of trace calls, [ad-hoc tracing APIs](#ad-hoc-tracing-apis) and [transaction-trace filtering APIs](#transaction-trace-filtering-apis).
Expand Down
12 changes: 12 additions & 0 deletions docs/public-networks/reference/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ import TabItem from '@theme/TabItem';

:::

:::caution Forest pruning deprecation notice

Forest pruning (using the [`--pruning-enabled`](../cli/options.md#pruning-enable.md#pruning-enabled) option) is deprecated and will be removed in a future release. We recommend using [Bonsai Tries](../../concepts/data-storage-formats.md#bonsai-tries) as an alternative for saving disk space.

:::

<Postman />

## `ADMIN` methods
Expand Down Expand Up @@ -7210,6 +7216,12 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"trace_rawTransaction","params":[
Provides transaction processing tracing per block.
:::caution Forest pruning deprecation notice
Forest pruning (using the [`--pruning-enabled`](../cli/options.md#pruning-enabled) option) is deprecated and will be removed in a future release. We recommend using [Bonsai Tries](../../concepts/data-storage-formats.md#bonsai-tries) as an alternative for saving disk space.
:::
:::info
When using [Bonsai](../../concepts/data-storage-formats.md#bonsai-tries), the requested block must be within the number of [blocks retained](../cli/options.md#bonsai-historical-block-limit) (by default, 512 from the head of the chain).
Expand Down
137 changes: 89 additions & 48 deletions docs/public-networks/reference/cli/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -966,52 +966,6 @@ ethstats-contact="contact@mail.com"

Contact email address to send to the Ethstats server specified by [`--ethstats`](#ethstats).

### `sync-min-peers`

<Tabs>

<TabItem value="Syntax" label="Syntax" default>

```bash
--sync-min-peers=<INTEGER>
```

</TabItem>

<TabItem value="Example" label="Example">

```bash
--sync-min-peers=8
```

</TabItem>

<TabItem value="Environment variable" label="Environment variable">

```bash
BESU_FAST_SYNC_MIN_PEERS=8
```

</TabItem>

<TabItem value="Example configuration file" label="Example configuration file">

```bash
sync-min-peers=8
```

</TabItem>

</Tabs>

The minimum number of peers required before starting [sync](../../get-started/connect/sync-node.md). The default is 5.

:::info

This option does not apply to PoS networks.

:::

### `genesis-file`

<Tabs>
Expand Down Expand Up @@ -2856,9 +2810,9 @@ Using pruning with [private transactions](../../../private-networks/concepts/pri

:::

:::note
:::caution

Pruning is being deprecated for [Bonsai Tries](../../concepts/data-storage-formats.md#bonsai-tries) and is currently not being updated.
This option is deprecated and will be removed in a future release. We recommend using [Bonsai Tries](../../concepts/data-storage-formats.md#bonsai-tries) as an alternative for saving disk space.

:::

Expand Down Expand Up @@ -4555,6 +4509,52 @@ strict-tx-replay-protection-enabled=false

Enables or disables replay protection, in accordance with [EIP-155](https://eips.ethereum.org/EIPS/eip-155), on transactions submitted using JSON-RPC. The default is `false`.

### `sync-min-peers`, `fast-sync-min-peers`

<Tabs>

<TabItem value="Syntax" label="Syntax" default>

```bash
--sync-min-peers=<INTEGER>
```

</TabItem>

<TabItem value="Example" label="Example">

```bash
--sync-min-peers=8
```

</TabItem>

<TabItem value="Environment variable" label="Environment variable">

```bash
BESU_SYNC_MIN_PEERS=8
```

</TabItem>

<TabItem value="Example configuration file" label="Example configuration file">

```bash
sync-min-peers=8
```

</TabItem>

</Tabs>

The minimum number of peers required before starting [sync](../../get-started/connect/sync-node.md). The default is `5`. Set to `1` to enable static peers to contribute to the initial sync.

:::info

This option does not apply to Proof of Stake networks.

:::

### `sync-mode`

<Tabs>
Expand Down Expand Up @@ -4983,6 +4983,47 @@ instead of the number of transactions.
To configure the maximum memory capacity, use [`--tx-pool-layer-max-capacity`](#tx-pool-layer-max-capacity).
:::

### `tx-pool-min-gas-price`

<Tabs>

<TabItem value="Syntax" label="Syntax" default>

```bash
--tx-pool-min-gas-price=<INTEGER>
```

</TabItem>

<TabItem value="Example" label="Example">

```bash
--tx-pool-min-gas-price=2000
```

</TabItem>

<TabItem value="Environment variable" label="Environment variable">

```bash
BESU_TX_POOL_MIN_GAS_PRICE=2000
```

</TabItem>

<TabItem value="Configuration file" label="Configuration file">

```bash
tx-pool-min-gas-price="2000"
```

</TabItem>

</Tabs>

The minimum gas price, in wei, required for a transaction to be accepted into the [transaction pool](../../concepts/transactions/pool.md).


### `tx-pool-no-local-priority`

<Tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ You can also install:

To configure Prometheus and run with Besu:

1. Configure Prometheus to poll Besu. For example, add the following YAML fragment to the `scrape_configs` block of the `prometheus.yml` file:
1. Configure Prometheus to poll Besu.
For example, add the following YAML fragment to the `scrape_configs` block of the `prometheus.yml` file:

<Tabs>

<TabItem value="Fragment to insert in prometheus.yml" label="Fragment to insert in prometheus.yml" default>
<Tabs>
<TabItem value="Fragment to insert in prometheus.yml">

```yml
- job_name: besu
Expand All @@ -58,9 +58,8 @@ To configure Prometheus and run with Besu:
- localhost:9545
```
</TabItem>

<TabItem value="Full prometheus.yml example" label="Full prometheus.yml example">
</TabItem>
<TabItem value="Full prometheus.yml example">
```yml
global:
Expand All @@ -80,42 +79,42 @@ To configure Prometheus and run with Besu:
- localhost:9545
```
</TabItem>

</Tabs>
</TabItem>
</Tabs>
Prometheus requires 3 MB of space per node per hour for metrics, with a `scrape_interval` of 15 seconds.

2. Start Besu with the [`--metrics-enabled`](../../reference/cli/options.md#metrics-enabled) option. To start a single node for testing with metrics enabled, run the following command:

<Tabs>
2. Start Besu with the [`--metrics-enabled`](../../reference/cli/options.md#metrics-enabled) option.
To start a single node for testing with metrics enabled, run the following command:

<TabItem value="Syntax" label="Syntax" default>
<Tabs>
<TabItem value="Syntax">

```bash
besu --network=dev --miner-enabled --miner-coinbase <COINBASE ADDRESS> --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-enabled
```

</TabItem>

<TabItem value="Example" label="Example">
</TabItem>
<TabItem value="Example">

```bash
besu --network=dev --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-enabled
```

</TabItem>

</Tabs>
</TabItem>
</Tabs>

To specify the host and port on which Prometheus accesses Besu, use the [`--metrics-host`](../../reference/cli/options.md#metrics-host) and [`--metrics-port`](../../reference/cli/options.md#metrics-port) options. The default host and port are 127.0.0.1 (`localhost`) and 9545.
To specify the host and port on which Prometheus accesses Besu, use the
[`--metrics-host`](../../reference/cli/options.md#metrics-host) and
[`--metrics-port`](../../reference/cli/options.md#metrics-port) options.
The default host and port are `127.0.0.1` (`localhost`) and `9545`.

:::danger

To avoid DNS rebinding attacks, if running Prometheus on a different host than your Besu node (any host other than `localhost`), add the hostname that Prometheus uses to [`--host-allowlist`](../../reference/cli/options.md#host-allowlist).

For example, if Prometheus is configured to get metrics from `http://besu.local:8008/metrics`, then `besu.local` has to be in `--host-allowlist`.

To avoid DNS rebinding attacks, if running Prometheus on a different host than your Besu node
(any host other than `localhost`), add the hostname that Prometheus uses to
[`--host-allowlist`](../../reference/cli/options.md#host-allowlist).
For example, if Prometheus is configured to get metrics from `http://besu.local:8008/metrics`,
then `besu.local` has to be in `--host-allowlist`.
:::

3. In another terminal, run Prometheus specifying the `prometheus.yml` file:
Expand All @@ -127,18 +126,21 @@ To configure Prometheus and run with Besu:
4. View the [Prometheus graphical interface](#view-prometheus-graphical-interface).

:::tip

Use a log ingestion tool, such as Logstash, to parse the logs and alert you to configured anomalies.

:::

## Run Prometheus with Besu in push mode

The [`--metrics-enabled`](../../reference/cli/options.md#metrics-enabled) option enables Prometheus polling of Besu, but sometimes metrics are hard to poll (for example, when running inside Docker containers with varying IP addresses). To enable Besu to push metrics to a [Prometheus push gateway](https://github.com/prometheus/pushgateway), use the [`--metrics-push-enabled`](../../reference/cli/options.md#metrics-push-enabled) option.
The [`--metrics-enabled`](../../reference/cli/options.md#metrics-enabled) option enables Prometheus
polling of Besu, but sometimes metrics are hard to poll (for example, when running inside Docker
containers with varying IP addresses).
To enable Besu to push metrics to a [Prometheus push gateway](https://github.com/prometheus/pushgateway),
use the [`--metrics-push-enabled`](../../reference/cli/options.md#metrics-push-enabled) option.

To configure Prometheus and run with Besu pushing to a push gateway:

1. Configure Prometheus to read from a push gateway. For example, add the following YAML fragment to the `scrape_configs` block of the `prometheus.yml` file:
1. Configure Prometheus to read from a push gateway.
For example, add the following YAML fragment to the `scrape_configs` block of the `prometheus.yml` file:

```yml
- job_name: push-gateway
Expand All @@ -149,7 +151,8 @@ To configure Prometheus and run with Besu pushing to a push gateway:
- localhost:9091
```

1. Start the push gateway. You can deploy the push gateway using the Docker image:
1. Start the push gateway.
You can deploy the push gateway using the Docker image:

```bash
docker pull prom/pushgateway
Expand All @@ -158,25 +161,22 @@ To configure Prometheus and run with Besu pushing to a push gateway:

1. Start Besu specifying the `--metrics-push-enabled` option and port of the push gateway:

<Tabs>

<TabItem value="Syntax" label="Syntax" default>
<Tabs>
<TabItem value="Syntax">

```bash
besu --network=dev --miner-enabled --miner-coinbase <COINBASE ADDRESS> --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-push-enabled --metrics-push-port=9091 --metrics-push-host=127.0.0.1
```

</TabItem>

<TabItem value="Example" label="Example">
</TabItem>
<TabItem value="Example">

```bash
besu --network=dev --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-push-enabled --metrics-push-port=9091 --metrics-push-host=127.0.0.1
```

</TabItem>

</Tabs>
</TabItem>
</Tabs>

1. In another terminal, run Prometheus specifying the `prometheus.yml` file:

Expand Down

0 comments on commit cf242b8

Please sign in to comment.