Skip to content

Commit

Permalink
Merge branch 'main' into 1625-restrict-peers
Browse files Browse the repository at this point in the history
  • Loading branch information
m4sterbunny committed Jul 22, 2024
2 parents be89278 + f56d84d commit fd16837
Show file tree
Hide file tree
Showing 303 changed files with 45,373 additions and 108 deletions.
62 changes: 62 additions & 0 deletions .github/scripts/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
#
# Besu Docs new Besu version update helper
#

log_error() {
echo "ERROR: $1"
exit 1
}

# Validate the environment variables set
[[ -z "$VERSION" ]] && log_error "Environment variable VERSION cannot be empty"

FILE="${FILE:-docusaurus.config.js}"
GIT_NAME="${GIT_NAME:-Besu Bot}"
GIT_EMAIL="${GIT_EMAIL:-devops@consensys.net}"
BASE_BRANCH="${BASE_BRANCH:-main}"
BRANCH="besu-version-$VERSION"

# Configure git
git config --global user.name "$GIT_NAME"
git config --global user.email "$GIT_EMAIL"

# Create branch
git checkout -b "$BRANCH"

# https://docs-template.consensys.io/configure/versioning#create-a-docs-version
yarn install
npm run docusaurus docs:version "$VERSION" > /dev/null
git add "versioned_docs/version-$VERSION/"
git add "versioned_sidebars/version-$VERSION-sidebars.json"

git add versions.json

# Remove stable mark from the existing version
sed -i 's/label\: "stable (\([0-9]*\.[0-9]*\.[0-9]*\))"/label: "\1"/' "$FILE"

# Add new release as stable version
sed -i "/\/\/ STABLE-AUTOMATION-TOKEN/a \ \"$VERSION\": {\n\ label: \"stable ($VERSION)\",\n\ }," "$FILE"

# Update the latest version
sed -i "s/lastVersion: \"[0-9]*\.[0-9]*\.[0-9]*\"/lastVersion: \"$VERSION\"/" "$FILE"

# Output the diff
git diff "$FILE"
git diff versions.json

# Commit and push branch
git add "$FILE"
git commit -s -m "Update version $VERSION"
git push origin "$BRANCH"

# Output Git status to see any unexpected file changes. These could be due to changes in the process
echo "===== Git status after commit ====="
git status -s
echo "==================================="

# Attempt to create PR. If no permission skip the PR creation
echo "Attempt to create PR using base branch $BASE_BRANCH"
gh pr create --base "$BASE_BRANCH" --title "Update Besu version $VERSION" --body "Besu version updated to $VERSION" || {
echo "WRAN: Action does not have permission to create PRs. Ignoring..."
}
93 changes: 0 additions & 93 deletions .github/update.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update Version

on:
release:
types: ["released"]
workflow_dispatch:
inputs:
version:
type: string
required: true

jobs:
update:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || github.event.release.name }}
permissions:
contents: write
pull-requests: write
steps:
- name: Validate version
id: version
run: |
# Validate provided version compatible with the format
echo "${{ env.VERSION }}" | grep -q -e "^[0-9]*\.[0-9]*\.[0-9]*$" || {
echo "Version [${{ env.VERSION }}] is not in expected format '^[0-9]*\.[0-9]*\.[0-9]*$'"
exit 1
}
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Update version
run: .github/scripts/update-version.sh
env:
VERSION: ${{ env.VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions docs/public-networks/how-to/bonsai-limit-trie-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Before executing these example commands on your node, modify them to apply to yo
1. Stop Besu.
1. (Optional) Run the Besu trie log prune command. Specify the Bonsai Trie data storage format and the data directory for your Besu database:
```bash
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu --sync-mode=X_SNAP storage trie-log prune
sudo /usr/local/bin/besu/bin/besu --data-storage-format=BONSAI --data-path=/var/lib/besu --sync-mode=SNAP storage trie-log prune
```
1. Start Besu.
1. Look for `Limit trie logs enabled: retention: 512; prune window: 30000` in your Besu configuration printout at startup.
Expand Down Expand Up @@ -198,8 +198,8 @@ You must shut down the Besu client before running the subcommand.
- `java.lang.IllegalStateException: Unable to change the sync mode when snap sync is incomplete, please restart with snap sync mode`

Check that you have specified `--sync-mode`.
The default is `--sync-mode=FAST`.
Most Mainnet users use `X_SNAP` or `X_CHECKPOINT`.
The default is `--sync-mode=SNAP`.
Most Mainnet users use `SNAP` or `CHECKPOINT`.

### Cannot run trie log prune

Expand Down
24 changes: 24 additions & 0 deletions docs/public-networks/how-to/use-configuration-file/profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ You can use the following profiles:
- [Staker profile](#staker-profile)
- [Enterprise/Private profile](#enterpriseprivate-profile)

You can also [load external profiles](#load-external-profiles).

:::note
Run `./besu --help` to view all available profiles.
:::

## Minimalist staker profile

For stakers who want to maximize their hardware value but don't want to serve full sets of data to
Expand Down Expand Up @@ -80,3 +86,21 @@ besu --profile=private
:::note
`enterprise` and `private` are aliases for the same profile.
:::

## Load external profiles

You can use external profiles to create custom Besu bundles with various plugins and their default options.

Add external profiles to a `profiles` directory under the root Besu directory.
Run Besu with [`--profile`](../../reference/cli/options.md#profile) set to the external profile
file name, without the `.toml` extension.
For example, to load the `profiles/custom_profile.toml` profile, run:

```bash
besu --profile=custom_profile
```

:::note
You can overwrite the directory in which to place external profiles using the `besu.profiles.dir`
system property.
:::
23 changes: 13 additions & 10 deletions docs/public-networks/reference/cli/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2678,16 +2678,17 @@ network="holesky"

The predefined network configuration. The default is `mainnet`.

Possible values are:

| Network | Chain | Type | Default Sync Mode | Description |
| :-------- | :---- | :-----------| :----------------- | :------------------------------------------------------------- |
| `mainnet` | ETH | Production | [FAST](#sync-mode) | The main network |
| `holesky` | ETH | Test | [FAST](#sync-mode) | A PoS network |
| `sepolia` | ETH | Test | [FAST](#sync-mode) | A PoS network |
| `dev` | ETH | Development | [FULL](#sync-mode) | A PoW network with a low difficulty to enable local CPU mining |
| `classic` | ETC | Production | [FAST](#sync-mode) | The main Ethereum Classic network |
| `mordor ` | ETC | Test | [FAST](#sync-mode) | A PoW network |
Possible values include the following:

| Network | Chain | Type | Default Sync Mode | Consensus Mechanism | Description |
| :-------- | :---- | :-----------| :----------------- | :----------------------- | :----------------------------------------------------------------------------------- |
| `mainnet` | ETH | Production | [SNAP](#sync-mode) | A PoS network | The main [Ethereum network](https://ethereum.org/en/developers/docs/networks/) |
| `holesky` | ETH | Test | [SNAP](#sync-mode) | A PoS network | Multi-client testnet [Hoelsky](https://holesky.dev) |
| `sepolia` | ETH | Test | [SNAP](#sync-mode) | A PoS network | Multi-client testnet [Sepolia](https://sepolia.dev) |
| `lukso` | ETH | Production | [SNAP](#sync-mode) | A PoS network | Network for the [Lukso chain](https://lukso.network/) |
| `dev` | ETH | Development | [FULL](#sync-mode) | A PoW network | Development network with low difficulty to enable local CPU mining |
| `classic` | ETC | Production | [SNAP](#sync-mode) | A PoW network | The main [Ethereum Classic network](https://ethereumclassic.org) |
| `mordor ` | ETC | Test | [SNAP](#sync-mode) | A PoW network | Testnet for [Ethereum Classic](https://github.com/eth-classic/mordor) |

:::tip

Expand Down Expand Up @@ -3002,6 +3003,8 @@ Possible values are:
- [`minimalist_staker`](../../how-to/use-configuration-file/profile.md#minimalist-staker-profile)
- [`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)
- File name of an [external profile](../../how-to/use-configuration-file/profile.md#load-external-profiles),
without the `.toml` extension
### `random-peer-priority-enabled`
Expand Down
7 changes: 5 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const config = {
path: "./docs",
includeCurrentVersion: true,
// Set to the last stable release
lastVersion: "24.6.0",
lastVersion: "24.7.0",
versions: {
//defaults to the ./docs folder
// using 'development' instead of 'next' as path
Expand All @@ -47,8 +47,11 @@ const config = {
},
// The last stable release in the versioned_docs/version-stable
// STABLE-AUTOMATION-TOKEN. Don't remove this as this is used for version update automation
"24.7.0": {
label: "stable (24.7.0)",
},
"24.6.0": {
label: "stable (24.6.0)",
label: "24.6.0",
},
"24.5.2": {
label: "24.5.2",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit fd16837

Please sign in to comment.