Start Besu
Nodes can connect to Ethereum Mainnet, Linea, and their respective public testnets.
Use the besu command with the required command line options to start a node.
Prerequisites
Local block data
When connecting to a network other than the network previously connected to, you must either delete the local block data or use the --data-path option to specify a different data directory.
To delete the local block data, delete the database directory in the besu/build/distribution/besu-<version> directory.
Genesis configuration
Besu specifies the genesis configuration, and sets the network ID and bootnodes when connecting to ETH testnets, and Mainnet.
The genesis files defining the genesis configurations are in the Besu source files.
To define a genesis configuration, create a genesis file (for example, genesis.json) and specify the file using the --genesis-file option.
Syncing and storage
By default, Besu syncs to the current state of the blockchain using snap sync in:
- Networks specified using
--network. - Ethereum Mainnet.
We recommend using snap sync for a faster sync, by starting Besu with --sync-mode=SNAP.
By default, Besu stores data in the Bonsai Tries format.
Run a node on an Ethereum testnet
- Hoodi
- Sepolia
- Ephemery
To run a node on Hoodi specifying a data directory:
besu --network=hoodi --data-path=<path>/<hoodidata-path>
Where <path> and <hoodidata-path> are the path and directory to save the Hoodi chain data to.
To run a node on Sepolia specifying a data directory:
besu --network=sepolia --data-path=<path>/<sepoliadata-path>
Where <path> and <sepoliadata-path> are the path and directory to save the Sepolia chain data to.
To run a node on Ephemery specifying a data directory:
besu --network=ephemery --data-path=<path>/<ephemery-data-path>
Where <path> and <ephemery-data-path> are the path and directory to save the Ephemery chain data to.
See the guide on connecting to a testnet for more information.
Run a node on Ethereum Mainnet
To run a node on the Ethereum Mainnet:
besu
To run a node on Mainnet with the HTTP JSON-RPC service enabled and available for localhost only:
besu --rpc-http-enabled
See the guide on connecting to Mainnet for more information.
Run a node for local development
Besu doesn't provide a built-in development network. Use one of the following instead:
- Ephemery is a public testnet that resets
periodically. Start Besu with
--network=ephemeryand pair it with a consensus client, as described in Run Besu and Teku on a testnet. - Kurtosis runs a self-contained network of execution and consensus clients in Docker.
To run an isolated network that you control, define your own genesis file and start a private network. The Developer Quickstart generates one for you.
Confirm node is running
If you started Besu with the --rpc-http-enabled option, use cURL to call JSON-RPC API methods to confirm the node is running.
-
eth_chainIdreturns the chain ID of the network.curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' localhost:8545/ -H "Content-Type: application/json" -
eth_syncingreturns the starting, current, and highest block.curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' localhost:8545/ -H "Content-Type: application/json"For example, after connecting to Mainnet,
eth_syncingwill return something similar to:{"jsonrpc": "2.0","id": 1,"result": {"startingBlock": "0x0","currentBlock": "0x2d0","highestBlock": "0x66c0"}}