Skip to main content

Use Docker

You can use Docker to run Hyperledger Besu, Linea Besu, or Geth as a Linea node on Mainnet or Linea Sepolia.

Prerequisites​

Download and install Docker.

Run a standard Besu node​

Important

The Besu Docker image does not run on Windows.

Step 1. Download configuration files​

Download the configuration files for the relevant network (in ZIP format) and extract them. The configuration files include the network genesis file, Docker Compose file and Besu configuration file.

Download the mainnet besu-mainnet ZIP file.

enodes

You can choose from a range of edge nodes (enodes) for Linea Mainnet. The Besu .zip includes a config file named config-snap-mainnet.toml where enodes are specified. The file uses all enodes by default.

See our enodes page for a full list of available enodes.

Step 2. Update the Docker Compose file​

In the docker-compose.yaml file, update the --p2p-host command to include your public IP address. For example:

--p2p-host=103.10.10.10
tip

You can use this page to find your public IP address.

Step 3. Start the Besu node​

Open a terminal, in the directory containing the docker-compose.yml file, run docker-compose up.

It can take up to 20 minutes for the node to find peers. If it takes any longer than that, try restarting the node.

Troubleshoot peering issues

Refer to the Besu troubleshooting information for help if you experience peering issues.

Run a Linea Besu node​

Linea Besu is an implementation of the Hyperledger Besu client that extends its functionality.

We recommend using Linea Besu over standard Besu if you intend to run a node and use it to interact with the blockchain, rather than just following it.

Linea Besu enables you to use plugins adapted specifically for Linea, such as the Linea Sequencer plugin.

These plugins are necessary, in different ways, to enable full functionality for the node. Linea-specific API endpoints like linea_estimateGas, for example, require the linea-sequencer plugin. You can pick a plugin by selecting a profile in step 1.

This guide is for infrastructure providers and operators who intend to run a Linea node. This is relevant to you if:

  • You are responsible for operating nodes as a service for others to use
  • You want to use Linea with a personal, private RPC endpoint.

Step 1. Download the relevant docker-compose.yaml file​

Access the /docker directory in the Linea Besu repository. There are several .yaml files here corresponding to Besu profiles. Each profile enables you to run a node with different Linea Besu plugin configurations depending on your use case.

Download the appropriate .yaml file for your use case:

  • basic-mainnet: Creates a basic follower node on Linea Mainnet with no plugins enabled.
  • advanced-mainnet: Creates an advanced node on Linea Mainnet with plugins that enable support for linea_estimateGas and the finalized block parameter tag.

Step 2. Update IP address​

In the .yaml file you downloaded, adjust the --p2p-host command with your public IP address:

--p2p-host=103.10.10.10
tip

You can use this page to find your public IP address.

Step 3. Configure your L1 RPC endpoint​

If you're using an advanced profile, insert your preferred L1 RPC endpoint in the docker-compose.yaml file:

--plugin-linea-l1-rpc-endpoint=YOUR_L1_RPC_ENDPOINT

If you only intend to run a basic profile, go straight to the next step.

Step 4. Start the Linea Besu node​

In a terminal, navigate to your .yaml file's directory. Then start the node by running docker compose:

docker compose -f ./your-file-path/docker-compose-advanced-mainnet.yaml up

Alternatively, you can run a node without downloading a .yaml file with a docker run command. For example:

docker run -e BESU_PROFILE=advanced-mainnet consensys/linea-besu-package:latest

Adjust the BESU_PROFILE to match one of the profiles listed in step 1.

Run a Geth node​

Step 1. Download configuration files​

Download the configuration files for the relevant network. Ensure that you download the files to the same directory.

Download the mainnet docker-compose.yml and genesis.json files.

enodes

You can choose from a range of edge nodes (enodes) for Linea Mainnet. The Geth docker-compose.yml file uses all enodes by default.

See our enodes page for a full list of available enodes.

Step 2. Start the Geth node​

Open up a terminal where the both docker-compose.yml and genesis.json are located (they should be in the same directory) and run docker compose up

The node should now be running and looking for peers to sync.

Confirm the node is running​

You can call the JSON-RPC API methods to confirm the node is running. For example, call eth_syncing to return the synchronization status. For example the starting, current, and highest block, or false if not synchronizing (or if the head of the chain has been reached).


curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'

You should get a result similar to:

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"startingBlock": "0x0",
"currentBlock": "0x5d228",
"highestBlock": "0x3cedec"
}
}