Use a binary distribution
You can install the Hyperledger Besu or Geth client to run a Linea node from a binary distribution.
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
- Testnet
Mainnet genesis-mainnet.json
file and Besu
config-mainnet.toml
file.
Testnet genesis-goerli.json
file and Besu
config-goerli.toml
file.
Step 3. Define disk space volume (optional)
Define a volume of at least 100GB
, more if you want to future-proof your node, and mount the Besu data-path
to the
custom volume when you [start the node].
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 - Decide on the maximum size you want for the volume, for example 100GB
- 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 - Decide on the maximum size you want for the volume, for example 100GB
- 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 - Decide on the maximum size for the volume, for example 100GB
- 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 - Decide on the maximum size you want for the volume, for example 100GB
- 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
or config-goerli.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:
- Mainnet
- Testnet
besu --config-file=/Users/myuser/mainnet/config-mainnet.toml
besu --config-file=/Users/myuser/goerli/config-goerli.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 v1.11.6 Geth (latest untested) and install using the instructions provided here
Step 2. Download the genesis file
Download the genesis file for the relevant network.
- Mainnet
- Testnet
Mainnet genesis.json
file.
Testnet genesis.json
file.
Step 3. Define disk space volume (optional)
Define a volume of at least 100GB
, more if you want to future-proof your node, and 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.
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 - Decide on the maximum size you want for the volume, for example 100GB
- 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 - Decide on the maximum size you want for the volume, for example 100GB
- 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 - Decide on the maximum size for the volume, for example 100GB
- 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 - Decide on the maximum size you want for the volume, for example 100GB
- 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:
- Mainnet
- Testnet
geth --datadir ./geth-linea-data init ./genesis.json
geth --datadir ./geth-uat-data init ./genesis.json
Step 5. Start the Geth client
Start the node using the following command:
- Mainnet
- Testnet
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
geth \
--datadir $HOME/geth-uat-data \
--networkid 59140 \
--rpc.allow-unprotected-txs \
--txpool.accountqueue 50000 \
--txpool.globalqueue 50000 \
--txpool.globalslots 50000 \
--txpool.pricelimit 1000000 \
--txpool.pricebump 1 \
--txpool.nolocals \
--http --http.addr '0.0.0.0' --http.port 8545 --http.corsdomain '*' --http.api 'web3,eth,txpool,net' --http.vhosts='*' \
--ws --ws.addr '0.0.0.0' --ws.port 8546 --ws.origins '*' --ws.api 'web3,eth,txpool,net' \
--bootnodes "enode://700f0d5a5f2beadc307b7b8f1a251f8b75033c8222ca65bfb1aecc4c4a0a86d6d6ef8420e780f6ace7cc3d1b837606b116109cc53b00931d3debc1346b9ccbb8@13.51.255.207:31001,enode://cbbaacaf47a005cb389b40f6676d63800cc65295aad0983e5ce9f2e5bf805274cded5ef313993a2564591d6caab6322c2a39a0b3a21143034378179c7d5ecd44@3.16.167.169:31001" \
--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"
}
}