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.
Get the EVM tool
The EVM tool is part of the standard Besu binary distribution.
Build from source
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
.
Execute the EVM tool:
ethereum/evmtool/build/install/evmtool/bin/evmtool <evmtool options>
Execute with Docker
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.
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.
EVM tool options
The first mode of the EVM tool runs an arbitrary EVM and is invoked without an extra command. Use command line options to specify the code and other contextual information. For example:
evmtool --code=5B600080808060045AFA50600056
The EVM tool also has subcommands used for testing code bases. These subcommands are not meant for typical user interactions.