Skip to main content

Linea Besu

Linea Besu is an implementation of the Besu client that extends its functionality using plugins adapted specifically for Linea, such as the Linea Sequencer plugin.

Plugins enable full functionality for the node. For example, Linea-specific API endpoints like linea_estimateGas require the linea-sequencer plugin. Plugins are installed with the advanced profile during the configuration steps.

warning

The advanced profile option doesn't currently support macOS/ARM. Please use Linux/ARM or Windows/X86_64.

We recommend using Linea Besu over standard Besu if you intend to run a node to interact with the blockchain, rather than just following it. Use Linea Besu 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.

Run using the binary distribution​

Step 1. Download the Linea Besu package​

Download the latest version of the Linea Besu package from the releases page.

note

Find the Assets subheading on the latest release and download the file named linea-besu-package-<version>.tar.gz.

Step 2. Extract the package contents​

The linea-besu-package-<version>.tar.gz is a compressed file; move it to the directory of your choice and extract it.

tar -xzvf linea-besu-package-<version>.tar.gz

Step 3. Define disk space volume (optional)​

Define a volume size appropriate to your expected usage. Besu nodes use:

  • Full node: Total size 226.78 GB; increasing by 7.28 GB daily
  • Archive node: Total size 2.92 TB; increasing by 4.53 GB daily

Last updated: Nov 18, 2024

Use these figures as a basis to determine the extent to which you want to future-proof your node.

Ensure you mount the data-path to the custom volume when you start the node.

note

Blockchain clients can take up a lot of disk space. By defining the amount of disk space you're willing to dedicate to your client (and the block data that it will be syncing), you can ensure that you still have enough room on your disk for whatever else you need.

Select the relevant operating system for the steps on how to create a custom volume.

Ubuntu
  • Open Terminal
  • Use the df -h command to check the available disk space
  • Choose a maximum size for the volume. We'll use 100GB for this example.
  • Use fallocate to create a file of the desired size, e.g. fallocate -l 100G myfile.img
  • Use mkfs.ext4 to format the file as an ext4 filesystem. e.g. mkfs.ext4 myfile.img
  • Mount the file using mount, e.g. mount -o loop myfile.img /mnt/myvolume
  • The contents will now be available in /mnt/myvolume, up to a maximum of 100GB
MacOS
  • Open Terminal
  • Use the df -h command to check the available disk space
  • Choose a maximum size for the volume. We'll use 100GB for this example.
  • Use hdiutil to create a sparse image of the desired size, e.g. hdiutil create -size 100g -type SPARSE -fs HFS+X myfile.dmg
  • Mount the image using hdiutil, e.g. hdiutil attach myfile.dmg
  • The contents will now be available mounted under /Volumes, up to a maximum of 100GB
Windows
Without Windows Subsystem Linux
  • Open Command Prompt as Administrator
  • Use the dir command to check available disk space on the volume you want to create the disk image
  • Choose a maximum size for the volume. We'll use 100GB for this example.
  • Use the fsutil command to create a sparse file of the desired size, e.g. fsutil file createnew myfile.img 107374182400 (for a 100GB file)
  • Initialize the disk image using diskpart:
    • diskpart
    • select vdisk file="myfile.img"
    • create vdisk maximum=100000
    • attach vdisk
    • exit
  • Format the volume using format, e.g. format F: /FS:NTFS /A:64K /Q
  • The new volume will now be available as drive letter F:, up to the maximum 100GB size

To mount an existing disk image:

  • Open Command Prompt as Administrator
  • Use diskpart
    • select vdisk file="myfile.img"
    • attach vdisk
  • The disk image will be mounted and accessible under the assigned drive letter
With Windows Subsystem Linux
  • Open WSL
  • Use the df -h command to check the available disk space
  • Choose a maximum size for the volume. We'll use 100GB for this example.
  • Use fallocate to create a file of the desired size, e.g. fallocate -l 100G myfile.img
  • Use mkfs.ext4 to format the file as an ext4 filesystem. e.g. mkfs.ext4 myfile.img
  • Mount the file using mount, e.g. mount -o loop myfile.img /mnt/myvolume
  • The contents will now be available in /mnt/myvolume, up to a maximum of 100GB

Step 4. Select a profile​

In the extracted directory, find profiles. The .toml configuration files in this folder define the parameters for each possible profile you can select for your Linea Besu node.

Select one according to your preferences:

  • 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 5. Start the Linea Besu client​

In a terminal, navigate to the linea-besu-package-<version> directory, where the bin, genesis, profiles etc. directories are.

Now run Linea Besu, specifying your preferred profile. The --plugin-linea-l1-rpc-endpoint must only be defined if you are running an advanced node, since this is needed to query finalization on L1.

bin/besu --profile=advanced-mainnet --plugin-linea-l1-rpc-endpoint=<endpoint> 

The node will attempt to find peers to begin synchronizing and to download the world state.

Run using Docker​

Prerequisites​

Download and install Docker.

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.