Skip to main content

Use a binary distribution

You can install the Hyperledger Besu or Geth client to run a Linea node from a binary distribution.

deprecation notice

Linea Goerli is being deprecated. We discourage new development with this testnet and recommend using Linea Sepolia instead.

Prerequisites​

Set up the required and recommended hardware and all the utilities. You can find the recommendations for the clients from the official documentation:

Run the Besu client​

Step 1. Install Besu​

Download and install Besu using the instructions in the official documentation.

Step 2. Download the genesis file and Besu configuration file​

Download the genesis file and Besu configuration file.

Mainnet genesis-mainnet.json file and Besu config-mainnet.toml file.

Step 3. Define disk space volume (optional)​

Define a volume size appropriate to your expected usage. As of March 20 2024, Besu nodes use:

  • Full nodes: 120GB, growing ~1.5GB per day.
  • Archive nodes: 740GB, growing ~9.5GB per day.

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

To limit disk space required, we recommend you configure Besu to use the Bonsai data storage format, which prunes orphaned nodes and old branches.

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

note

Blockchain clients like Hyperledger Besu or Geth 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, but refer to the Geth or Besu explanation to help determine the value.
  • 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, but refer to the Geth or Besu explanation to help determine the value.
  • 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, but refer to the Geth or Besu explanation to help determine the value.
  • 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, but refer to the Geth or Besu explanation to help determine the value.
  • 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. Configure the Besu configuration file.​

In your Besu configuration file (config-mainnet.toml, config-goerli.toml, or config-sepolia.toml), configure the following options:

  • Set data-path to the location you want to store your data.
  • Set genesis-file to the path of your downloaded genesis file.

Step 5. Start the Besu client​

Run the Besu client with the location of your configuration file. For example:

besu --config-file=/Users/myuser/mainnet/config-mainnet.toml

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

Run the Geth client​

Step 1. Install Geth​

Download Geth and install using the instructions provided here.

warning

Linea only supports Geth up to v1.13.15 or lower. v1.14.0 and subsequent versions are not supported.

Step 2. Download the genesis file​

Download the genesis file for the relevant network.

Mainnet genesis.json file.

Step 3. Define disk space volume (optional)​

Define a volume size appropriate to your expected usage. As of March 20 2024, Geth nodes use:

  • Full nodes: 170GB, growing ~2.6GB per day.
  • Archive nodes: 760GB, growing ~10GB per day.

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

Ensure you mount the Geth datadir to the custom volume.

If you run out of space, or need to actively maintain how much space is being used, consider pruning.

note

Blockchain clients like Hyperledger Besu or Geth 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, but refer to the Geth or Besu explanation to help determine the value.
  • 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, but refer to the Geth or Besu explanation to help determine the value.
  • 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, but refer to the Geth or Besu explanation to help determine the value.
  • 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, but refer to the Geth or Besu explanation to help determine the value.
  • 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. Bootstrap your node​

Bootstrap the node using the following command:

geth --datadir ./geth-linea-data init ./genesis.json

Step 5. Start the Geth client​

Start the node using the following command:

geth \
--datadir $HOME/geth-linea-data \
--networkid 59144 \
--rpc.allow-unprotected-txs \
--txpool.accountqueue 50000 \
--txpool.globalqueue 50000 \
--txpool.globalslots 50000 \
--txpool.pricelimit 1000000 \
--txpool.pricebump 1 \
--txpool.nolocals \
--http --http.addr '127.0.0.1' --http.port 8545 --http.corsdomain '*' --http.api 'web3,eth,txpool,net' --http.vhosts='*' \
--ws --ws.addr '127.0.0.1' --ws.port 8546 --ws.origins '*' --ws.api 'web3,eth,txpool,net' \
--bootnodes "enode://ca2f06aa93728e2883ff02b0c2076329e475fe667a48035b4f77711ea41a73cf6cb2ff232804c49538ad77794185d83295b57ddd2be79eefc50a9dd5c48bbb2e@3.23.106.165:30303,enode://eef91d714494a1ceb6e06e5ce96fe5d7d25d3701b2d2e68c042b33d5fa0e4bf134116e06947b3f40b0f22db08f104504dd2e5c790d8bcbb6bfb1b7f4f85313ec@3.133.179.213:30303,enode://cfd472842582c422c7c98b0f2d04c6bf21d1afb2c767f72b032f7ea89c03a7abdaf4855b7cb2dc9ae7509836064ba8d817572cf7421ba106ac87857836fa1d1b@3.145.12.13:30303" \
--syncmode full \
--metrics \
--verbosity 3

The Linea network only produces blocks if there is currently at least 1 pending transaction. If you see no incoming blocks to your node, that does not mean that the node is not syncing.

If you don't see any incoming blocks, check and make sure that you have at least one peer from the bootnodes; otherwise, you might not be connected to the Linea network.


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"
}
}