Skip to content

Commit

Permalink
fixes 1611: adds page for boilerplate config and clarifies profiles
Browse files Browse the repository at this point in the history
Signed-off-by: m4sterbunny <[email protected]>
  • Loading branch information
m4sterbunny committed Jul 2, 2024
1 parent 5caba7a commit 8a7d582
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 68 deletions.
37 changes: 37 additions & 0 deletions docs/public-networks/how-to/use-configuration-file/defaults.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Default configurations
sidebar_position: 1
todo: For future maintenance, this page would be better setup to import single-sourced partials that also serve the cli/options page. However, for PoC, the duplication/poor maintainability is tolerated for now.
---

# Default configurations

Besu is [highly-configurable](index.md#configuration-order-of-precedence), yet its default configurations provide a viable boilerplate.

This page provides a high level overview of the opinionated default configurations of vanilla Besu. By applying these defaults, a node is optimized for staking. These defaults may be used alongside a [pre-configured profile](profile.md) to support common use cases.

For example, using the [staking profile](profile.md#staker-profile) with the boilerplate config directs Besu to use Mainnet, creating a staking-optimized node ready to run with a [validator](https://ethereum.org/en/developers/docs/nodes-and-clients/node-architecture/#validators) and [consensus client](https://ethereum.org/en/developers/docs/nodes-and-clients/node-architecture/#consensus-client)

## Configuration

|Command|Default|Notes|
|---------------------------|--------------------|------------------------------------------|
|[`config-file`](../../reference/cli/options/#config-file)|None|Vanilla Besu assumes no configuration file|

## Storage

|Command|Default|Notes|
|---------------------------|--------------------|------------------------------------------|
|[`data-storage-format`](../../reference/cli/options/#data-storage-format)|BONSAI|Besu applies the most space-effiecient storage method|

## Peering

|Command|Default|Notes|
|---------------------------|--------------------|------------------------------------------|
|[`discovery-enabled`](../../reference/cli/options/#discovery-enabled)|True|Besu assumes the node will connect P2P|
|[`p2p-enabled`](../../reference/cli/options/#discovery-enabled)|True|Besu assumes the node will connect P2P|
|[`engine-rpc-enabled`](../../reference/cli/options/#engine-rpc-enabled)|True|Besu assumes the Engine API will be required to communicate with the consensus layer|

:::note
For a comprehensive understanding, all defaults are provided in the [reference](../../reference/cli/options.md).
:::
8 changes: 2 additions & 6 deletions docs/public-networks/how-to/use-configuration-file/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ tags:
- private networks
---

# Use a configuration file
A TOML configuration file simplifies overriding [default configuration settings](defaults.md) and reuse of configurations across node startups.

You can specify command line options in a TOML configuration file.
Save the configuration file and reuse it across node startups.
Specify the configuration file using the [`--config-file`](../../reference/cli/options.md#config-file) CLI option.

You can also [use a pre-configured profile](profile.md) for some common use cases.
Specify the configuration file using the [`--config-file`](../../reference/cli/options.md#config-file) CLI option. Configuration files may be [used alongside a pre-configured profile](profile.md) for some common use cases.

:::note

Expand Down
75 changes: 16 additions & 59 deletions docs/public-networks/how-to/use-configuration-file/profile.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,39 @@
---
sidebar_position: 1
title: Use a profile
sidebar_position: 2
---

# Use a profile
# Use a profile

To help you get started quickly, Besu provides pre-configured profiles containing custom settings
for some common use cases.
You can load these profiles using the [`--profile`](../../reference/cli/options.md#profile) CLI option.
For example:
Load a profile using the [`--profile` CLI option](../../reference/cli/options.md#profile).

```bash
besu --config-file=config.toml --profile=staker
```

In this example, `config.toml` is the user-provided [configuration file](index.md), and `staker` is
the pre-configured profile containing custom settings.

Any configuration options explicitly set in the configuration file or command line will overwrite
the same options set in the profile.
See the [configuration order of precedence](index.md#configuration-order-of-precedence) for more information.

You can use the following profiles:
You can optionally use profiles to extend Besu's configuration. Combined with the [boilerplate configuration](defaults.md), profiles simplify the process of applying vaiable defaults. Besu's pre-configured profiles optimize for the following supported use cases:

- [Minimalist staker profile](#minimalist-staker-profile)
- [Staker profile](#staker-profile)
- [Enterprise/Private profile](#enterpriseprivate-profile)


:::note

A configuration explicitly set in the configuration file or command line will
[override the same option/s](index.md#configuration-order-of-precedence) set in the profile.

:::

## Minimalist staker profile

For stakers who want to maximize their hardware value but don't want to serve full sets of data to
their peers, Besu provides a minimalist staker profile.
See the
[`--profile=minimalist_staker`](../../reference/cli/options.md#profile) is optimized for stakers who want to maximize their hardware value but don't want to serve full sets of data to their peers, See the
[minimalist staker profile on GitHub](https://github.com/hyperledger/besu/blob/8b64023a121ea996ef60e4b7e2299c5807683f90/config/src/main/resources/profiles/minimalist-staker.toml)
for the custom settings.

To use the minimalist staker profile, run Besu with
[`--profile`](../../reference/cli/options.md#profile) set to `minimalist_staker`:

```bash
besu --profile=minimalist_staker
```

## Staker profile

For stakers who want to maximize their hardware value and also want to serve full sets of data to
their peers, Besu providers a staker profile.
See the
[`--profile=staker`](../../reference/cli/options.md#profile) is optimized for stakers who want to maximize their hardware value while also serving full sets of data to their peers. See the
[staker profile on GitHub](https://github.com/hyperledger/besu/blob/8b64023a121ea996ef60e4b7e2299c5807683f90/config/src/main/resources/profiles/staker.toml)
for the custom settings.

To use the staker profile, run Besu with [`--profile`](../../reference/cli/options.md#profile) set to `staker`:

```bash
besu --profile=staker
```

## Enterprise/Private profile

For private network operators who want to minimize confusion by setting sensible defaults, Besu
provides an enterprise/private profile.
This profile is designed to handle specific use cases for private network operators.
See the
[enterprise/private profile on GitHub](https://github.com/hyperledger/besu/blob/8b64023a121ea996ef60e4b7e2299c5807683f90/config/src/main/resources/profiles/enterprise-private.toml)
[`--profile=private` / `--profile=enterprise`](../../reference/cli/options.md#profile) supports private network operators and enterprises by handling specific use cases that apply to private network operators. See the [enterprise/private profile on GitHub](https://github.com/hyperledger/besu/blob/8b64023a121ea996ef60e4b7e2299c5807683f90/config/src/main/resources/profiles/enterprise-private.toml)
for the custom settings.

To use the enterprise/private profile, run Besu with
[`--profile`](../../reference/cli/options.md#profile) set to `enterprise` or `private`:

```bash
besu --profile=enterprise
```

or

```bash
besu --profile=private
```

:::note
`enterprise` and `private` are aliases for the same profile.
:::
7 changes: 4 additions & 3 deletions docs/public-networks/reference/cli/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ tags:
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Command line options

This reference describes the syntax of the Hyperledger Besu command line interface (CLI) options.
This reference describes the syntax of the Hyperledger Besu configuration options.

:::info

Expand Down Expand Up @@ -2584,7 +2583,7 @@ UPnP support is often disabled by default in networking firmware. If disabled by

:::tip

Use `UPNPP2PONLY` if you wish to enable UPnP for p2p traffic but not JSON-RPC.
Use `UPNPP2PONLY` if you wish to enable UPnP for P2P traffic but not JSON-RPC.

:::

Expand Down Expand Up @@ -2961,6 +2960,8 @@ Possible values are:
- [`staker`](../../how-to/use-configuration-file/profile.md#staker-profile)
- [`enterprise` or `private`](../../how-to/use-configuration-file/profile.md#enterpriseprivate-profile) (aliases for the same profile)

The default is `null`.

### `random-peer-priority-enabled`

<Tabs>
Expand Down

0 comments on commit 8a7d582

Please sign in to comment.