[Node] Run your LINEA node

Node Science
3 min readJan 25, 2024

--

Welcome to Node Science! Here, you will learn and understand how to set up your node easily and quickly, without any prior technical knowledge.

Feel free to follow us on Twitter to stay updated on everything related to nodes and join our Discord for further discussion or any questions with our community!

If you want the fast version to launch your node in two commandes and without explications, click here.

Context & Introduction

Linea is a network that scales the experience of Ethereum. Its out-of-the-box compatibility with the Ethereum Virtual Machine enables the deployment of already-existing applications, as well as the creation of new ones that would be too costly on Mainnet. It also enables the community to use those dapps, at a fraction of the cost, and multiples the speed of Mainnet.

VPS configuration

To run a node you’ll need a VPS (Virtual Private Server) and one of the most reliable and cheapest solution is Contabo.

To run a Linea node, you can choose the CLOUD VPS 2 by clicking here. Note that you can opt for a more powerful server (VPS 3 or 4) to run multiple different nodes on it more economically.

Don’t forget to choose a password.

Once payment is complete, you’ll receive an e-mail with your IP address. To access your VPS and utilize its functionalities securely, it is necessary to install the Putty application, which facilitates a protected connection

Just connect to your VPS with your IP adress.

Procedure for deploying the node !

Make sure you copy (Ctrl+C) — paste (right-click your mouse) each command line, one by one, into your terminal. The italic text under each command is just extra info to help you get what the command does.

sudo apt-get update && sudo apt-get upgrade -y

Updating and upgrading Debian-based Linux system packages using, refreshes the package list and applies the latest updates automatically.

sudo apt-get install software-properties-common screen -y

Installs the software-properties-common package and screen utility.

sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum -y

Add the Ethereum Personal Package Archive (PPA) to your system, update your package list, and then install the Ethereum software.

wget https://docs.linea.build/files/genesis.json

Download the file genesis.json from Linea documentation site.

fallocate -l 100G linea.img

Uses fallocate to quickly allocate a file named linea.img with a size of 100 gigabytes.

mkfs.ext4 linea.img

Creates an Ext4 filesystem on the file linea.img, effectively formatting the file to act as an Ext4 filesystem disk image. This is useful for creating virtual disks, mounting them, and using them for various storage and testing purposes

mkdir linea_data
sudo mount -o loop linea.img linea_data

Creates a new directory named linea_data in the current working directory and mounts the linea.img file to the linea_data directory.

sudo geth --datadir ./linea_data init ./genesis.json

Sets up the specified directory (./linea_data) to be used as the data storage location for an Ethereum blockchain node, configured according to the genesis file (./genesis.json)

screen -S linea

Starts a new screen session.

sudo geth \
--datadir 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

Run the node.

Congratulations, you’ve just deployed your first node on Linea! Simply press CTRL+A+D to detach from the screen session; your node will keep running. And if you to reattach to the existing screen session, just type screen -r linea.

Feel free to follow us on Twitter to stay updated on everything related to nodes and join our Discord for further discussion or any questions with our community!

Links

--

--

Node Science
Node Science

Written by Node Science

Learn how to easily set up your node with Node Science ! https://discord.gg/XCWThSXzZp

Responses (2)