hyperledger / besu

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
https://www.hyperledger.org/projects/besu
Apache License 2.0
1.51k stars 834 forks source link

document the user profiles #6409

Closed macfarla closed 8 months ago

macfarla commented 9 months ago

create at least draft documentation for the new profiles, how to use them and how to override defaults etc.

Gabriel-Trintinalia commented 9 months ago

User Documentation

Introduction to --profile CLI Option in Besu

Besu introduces a new feature, the --profile CLI option. This feature allows users to load existing TOML configuration files from resources, thereby enabling the override of default options.

How to Use the --profile CLI Option

To use the --profile CLI option, you need to specify it when running Besu, along with the name of the profile you want to use. For example:

besu --config-file=config.toml --profile=STAKER

In this case, config.toml is the user-provided configuration file, and STAKER is the pre-configured profile containing custom settings.

Configuration Resolution

The configuration provider resolves settings in a cascading manner. It prioritizes settings in the following order:

  1. Environment variables
  2. Configuration file (specified by the --config-file option)
  3. Profile file (specified by the --profile option)
  4. Default values (used if no other configuration source is available)

For instance, if a setting is not found in the environment variables, Besu will look for it in the config.toml file. If the setting is not found in the config.toml file, Besu will then look for it in the STAKER.toml file. If the setting is not found in the STAKER.toml file, Besu will use the default value for that setting.

Available Profiles

The --profile flag accepts the following profiles:

Any configuration options explicitly set in the config file or command line will overwrite any of the defaults set via 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 offers a minimalist_staker profile. This profile implements the following defaults:

To use the minimalist_staker profile, run Besu with the --profile option set to minimalist_staker:

besu --profile=minimalist_staker

Please note that any configuration options explicitly set in the config file or command line will overwrite the defaults set via the minimalist_staker profile.

Enterprise/Private Profile

For private network operators who want to minimize unexpected confusion by setting sensible defaults, Besu offers an enterprise or private profile. This profile is designed to handle specific use-cases for private network operators.

To use the enterprise or private profile, run Besu with the --profile option set to enterprise or private:

besu --profile=enterprise

or

besu --profile=private

The enterprise or private profile implements the following defaults:

Please note that any configuration options explicitly set in the config file or command line will overwrite the defaults set via the enterprise or private profile.

Gabriel-Trintinalia commented 9 months ago

@non-fungible-nelson draft doco for the profile feature

non-fungible-nelson commented 9 months ago

nitpick

Besu will use the default value for that setting.

let's make this Besu will use the universal default value for that setting.

We are also missing the staker profile (maybe it can be a note at the end of the minimalist staker , or vice versa)

macfarla commented 8 months ago

closing this ticket now that there's a besu-docs ticket specifically for this.