Skip to content

Commit

Permalink
Merge branch 'main' into 1394-doc-eth_getBlockReceipts-API-method
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Sanko <mike.sanko@consensys.net>
  • Loading branch information
mjsmike62 authored Oct 27, 2023
2 parents 22beb16 + 3a1a2d4 commit 4c0d611
Show file tree
Hide file tree
Showing 300 changed files with 39,955 additions and 151 deletions.
6 changes: 3 additions & 3 deletions docs/private-networks/tutorials/kubernetes/charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ azure:
keyvaultName: azure-keyvault
# the tenant ID of the key vault
tenantId: azure-tenantId
# the subscription ID to use - this needs to be set explictly when using multi tenancy
# the subscription ID to use - this needs to be set explicitly when using multi tenancy
subscriptionId: azure-subscriptionId
```

Expand Down Expand Up @@ -223,7 +223,7 @@ azure:
keyvaultName: azure-keyvault
# the tenant ID of the key vault
tenantId: azure-tenantId
# the subscription ID to use - this needs to be set explictly when using multi tenancy
# the subscription ID to use - this needs to be set explicitly when using multi tenancy
subscriptionId: azure-subscriptionId

# the raw Genesis config
Expand Down Expand Up @@ -297,7 +297,7 @@ azure:
keyvaultName: azure-keyvault
# the tenant ID of the key vault
tenantId: azure-tenantId
# the subscription ID to use - this needs to be set explictly when using multi tenancy
# the subscription ID to use - this needs to be set explicitly when using multi tenancy
subscriptionId: azure-subscriptionId

node:
Expand Down
51 changes: 23 additions & 28 deletions docs/public-networks/how-to/troubleshoot/evm-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ tags:

# Use the EVM tool

The Besu EVM tool is a CLI program that executes arbitrary EVM programs and Ethereum State Tests outside the context of an operating node. Use the EVM tool for benchmarking and fuzz testing.
The Besu EVM tool is a CLI program that executes arbitrary EVM programs and Ethereum State Tests
outside the context of an operating node.
Use the EVM tool for benchmarking and fuzz testing.

## Get the EVM tool

The Besu EVM tool does not have a standard zip file distribution. To use, you need to either build from the source repository or use a pre-published docker image.
The EVM tool is part of the standard [Besu binary distribution](../../get-started/install/binary-distribution.md).

### Build from source

Expand All @@ -23,12 +25,13 @@ To build from source, run the following from the root of the Besu repository:
./gradlew :ethereum:evmTool:installDist
```

An extractable archive files is created in `ethereum/evmtool/build/distributions` and an executable installation in `ethereum/evmtool/build/install/evmtool`.
An extractable archive files is created in `ethereum/evmtool/build/distributions` and an executable
installation in `ethereum/evmtool/build/install/evmtool`.

Execute the EVM tool:

```bash
ethereum/evmtool/build/install/evmtool/bin/evm <evmtool options>
ethereum/evmtool/build/install/evmtool/bin/evmtool <evmtool options>
```

### Execute with Docker
Expand All @@ -39,36 +42,28 @@ To run the Besu EVM tool in a container:
docker run -rm <docker options> hyperledger/besu-evmtool:develop <evmtool options>
```

- Because no data is stored in local directories we recommended using the `-rm` docker option. The `-rm` option deletes the container at the end of execution.
- If you use an option that requires input from standard in, use the `-i` docker option. The `-i` option pipes standard input to the EVM tool.
- If you need to reference files we recommend using a docker file binding, such as `-v ${PWD}:/opt/data`, which maps the current directory to the `/opt/data` directory in the container.
- Because no data is stored in local directories we recommended using the `-rm` docker option.
The `-rm` option deletes the container at the end of execution.
- If you use an option that requires input from standard in, use the `-i` docker option.
The `-i` option pipes standard input to the EVM tool.
- If you need to reference files we recommend using a docker file binding, such as
`-v ${PWD}:/opt/data`, which maps the current directory to the `/opt/data` directory in the container.

:::note

The `latest` tag is the latest released version of Besu, starting with 1.5.3. The `develop` tag is the current main branch code that will go into a future release version of Besu.

The `latest` tag is the latest released version of Besu.
The `develop` tag is the current main branch code that will go into a future release version of Besu.
:::

## EVM tool run options

The first mode of the EVM tool runs an arbitrary EVM and is invoked without an extra command. [Command line options](../../reference/evm-tool.md) specify the code and other contextual information.

The EVM tool also has a [`state-test` subcommand](../../reference/evm-tool.md#state-test-options) that allows [Ethereum state tests](https://github.com/ethereum/tests/tree/develop/GeneralStateTests) to be evaluated, and a [`code-validate` subcommand](../../reference/evm-tool.md#eof-code-validation) that allows [Ethereum object formatted (EOF)](https://eips.ethereum.org/EIPS/eip-3540) code to be validated. Most of the options from EVM execution don't apply.

<!--tabs-->
## EVM tool options

# `state-test`
The first mode of the EVM tool runs arbitrary EVM bytecode.
Use [command line options](../../reference/evm-tool.md#options) to specify the code and other
contextual information.
For example:

```bash
evm state-test <state-test> --nomemory
evmtool --code=5B600080808060045AFA50600056
```

# `code-validate`

```bash
evm code-validate --file <file>
```

<!--/tabs-->

The [EVM tool reference](../../reference/evm-tool.md) provides more information on these modes.
The EVM tool also has [subcommands](../../reference/evm-tool.md#subcommands) used for testing code bases.
These subcommands are not meant for typical user interactions.
133 changes: 80 additions & 53 deletions docs/public-networks/reference/cli/subcommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,67 +91,43 @@ If you omit `--start-block`, the default start block is 0 (the beginning of the

If you are not running the command against the default network (Mainnet), specify the `--network` or `--genesis-file` parameter.

## `public-key`

Provides node public key related actions.

:::caution

To get the public key or address of a node, ensure you use the [`--data-path`](options.md#data-path) or [`--node-private-key-file`](options.md#node-private-key-file) option with the `public-key` command. Otherwise, a new [node key](../../concepts/node-keys.md) is silently generated when starting Besu.
## `operator`

:::
Provides operator actions.

### `export`
### `generate-log-bloom-cache`

<!--tabs-->

# Syntax

```bash
besu public-key export [--node-private-key-file=<file>] [--to=<key-file>] [--ec-curve=<ec-curve-name>]
```

# Example (to standard output)

```bash
besu --data-path=<node data path> public-key export --node-private-key-file=/home/me/me_node/myPrivateKey --ec-curve=secp256k1
besu operator generate-log-bloom-cache [--start-block=<BLOCK_NUMBER>] [--end-block=<BLOCK_NUMBER>]
```

# Example (to file)
# Example

```bash
besu --data-path=<node data path> public-key export --node-private-key-file=/home/me/me_node/myPrivateKey --to=/home/me/me_project/not_precious_pub_key --ec-curve=secp256k1
besu --network=goerli --data-path=/project/goerli operator generate-log-bloom-cache --start-block=0 --end-block=100000
```

<!--/tabs-->

Outputs the node public key to standard output or to the file specified by `--to=<key-file>`. You can output the public key associated with a specific private key file using the [`--node-private-key-file`](options.md#node-private-key-file) option. The default elliptic curve used for the key is `secp256k1`. Use the `--ec-curve` option to choose between `secp256k1` or `secp256r1`.

### `export-address`

<!--tabs-->

# Syntax
:::tip

```bash
besu public-key export-address [--node-private-key-file=<file>] [--to=<address-file>] [--ec-curve=<ec-curve-name>]
```
Manually executing `generate-log-bloom-cache` is not required unless you set the [`--auto-log-bloom-caching-enabled`](options.md#auto-log-bloom-caching-enabled) command line option to false.

# Example (to standard output)
:::

```bash
besu --data-path=<node data path> public-key export-address --node-private-key-file=/home/me/me_node/myPrivateKey --ec-curve=secp256k1
```
Generates cached log bloom indexes for blocks. APIs use the cached indexes for improved log query performance.

# Example (to file)
:::note

```bash
besu --data-path=<node data path> public-key export-address --node-private-key-file=/home/me/me_node/myPrivateKey --to=/home/me/me_project/me_node_address --ec-curve=secp256k1
```
Each index file contains 100000 blocks. The last fragment of blocks less that 100000 are not indexed.

<!--/tabs-->
:::

Outputs the node address to standard output or to the file specified by `--to=<address-file>`. You can output the address associated with a specific private key file using the [`--node-private-key-file`](options.md#node-private-key-file) option. The default elliptic curve used for the key is `secp256k1`. Use the `--ec-curve` option to choose between `secp256k1` or `secp256r1`.
To generate cached log bloom indexes while the node is running, use the [`admin_generateLogBloomCache`](../api/index.md#admin_generatelogbloomcache) API.

## `password`

Expand All @@ -177,43 +153,67 @@ besu password hash --password=myPassword123

Generates the hash of a given password. Include the hash in the [credentials file](../../how-to/use-besu-api/authenticate.md#credentials-file) for JSON-RPC API [authentication](../../how-to/use-besu-api/authenticate.md).

## `operator`
## `public-key`

Provides operator actions.
Provides node public key related actions.

### `generate-log-bloom-cache`
:::caution

To get the public key or address of a node, ensure you use the [`--data-path`](options.md#data-path) or [`--node-private-key-file`](options.md#node-private-key-file) option with the `public-key` command. Otherwise, a new [node key](../../concepts/node-keys.md) is silently generated when starting Besu.

:::

### `export`

<!--tabs-->

# Syntax

```bash
besu operator generate-log-bloom-cache [--start-block=<BLOCK_NUMBER>] [--end-block=<BLOCK_NUMBER>]
besu public-key export [--node-private-key-file=<file>] [--to=<key-file>] [--ec-curve=<ec-curve-name>]
```

# Example
# Example (to standard output)

```bash
besu --network=goerli --data-path=/project/goerli operator generate-log-bloom-cache --start-block=0 --end-block=100000
besu --data-path=<node data path> public-key export --node-private-key-file=/home/me/me_node/myPrivateKey --ec-curve=secp256k1
```

# Example (to file)

```bash
besu --data-path=<node data path> public-key export --node-private-key-file=/home/me/me_node/myPrivateKey --to=/home/me/me_project/not_precious_pub_key --ec-curve=secp256k1
```

<!--/tabs-->

:::tip
Outputs the node public key to standard output or to the file specified by `--to=<key-file>`. You can output the public key associated with a specific private key file using the [`--node-private-key-file`](options.md#node-private-key-file) option. The default elliptic curve used for the key is `secp256k1`. Use the `--ec-curve` option to choose between `secp256k1` or `secp256r1`.

Manually executing `generate-log-bloom-cache` is not required unless you set the [`--auto-log-bloom-caching-enabled`](options.md#auto-log-bloom-caching-enabled) command line option to false.
### `export-address`

:::
<!--tabs-->

Generates cached log bloom indexes for blocks. APIs use the cached indexes for improved log query performance.
# Syntax

:::note
```bash
besu public-key export-address [--node-private-key-file=<file>] [--to=<address-file>] [--ec-curve=<ec-curve-name>]
```

Each index file contains 100000 blocks. The last fragment of blocks less that 100000 are not indexed.
# Example (to standard output)

:::
```bash
besu --data-path=<node data path> public-key export-address --node-private-key-file=/home/me/me_node/myPrivateKey --ec-curve=secp256k1
```

To generate cached log bloom indexes while the node is running, use the [`admin_generateLogBloomCache`](../api/index.md#admin_generatelogbloomcache) API.
# Example (to file)

```bash
besu --data-path=<node data path> public-key export-address --node-private-key-file=/home/me/me_node/myPrivateKey --to=/home/me/me_project/me_node_address --ec-curve=secp256k1
```

<!--/tabs-->

Outputs the node address to standard output or to the file specified by `--to=<address-file>`. You can output the address associated with a specific private key file using the [`--node-private-key-file`](options.md#node-private-key-file) option. The default elliptic curve used for the key is `secp256k1`. Use the `--ec-curve` option to choose between `secp256k1` or `secp256r1`.

## `retesteth`

Expand Down Expand Up @@ -243,6 +243,33 @@ The command accepts the following command line options:
- [`--rpc-http-port`](options.md#rpc-http-port)
- [`--logging`](options.md#logging)

## `storage`

Provides storage related actions.

### `revert-variables`

<!--tabs-->

# Syntax

```bash
besu storage revert-variables --config-file <PATH-TO-CONFIG-FILE>
```

# Example

```bash
besu storage revert-variables --config-file ../besu-local-nodes/config/besu/besu1.conf
```

<!--/tabs-->

Reverts the modifications made by the [variables storage feature](https://github.com/hyperledger/besu/pull/5471).
If you need to downgrade Besu, first run this subcommand specifying the path to
the [configuration file](../../how-to/configuration-file.md) normally used to
start Besu.

## `validate-config`

<!--tabs-->
Expand All @@ -261,4 +288,4 @@ besu validate-config --config-file ../besu-local-nodes/config/besu/besu1.conf

<!--/tabs-->

Performs basic syntax validation of the specified [TOML configuration file](../../how-to/configuration-file.md). Checks TOML syntax (for example, valid format and unmatched quotes) and flags unknown options. Doesn't check data types, and doesn't check dependencies between options (this is done at Besu startup).
Performs basic syntax validation of the specified [configuration file](../../how-to/configuration-file.md). Checks TOML syntax (for example, valid format and unmatched quotes) and flags unknown options. Doesn't check data types, and doesn't check dependencies between options (this is done at Besu startup).
Loading

0 comments on commit 4c0d611

Please sign in to comment.