🐳Docker

Author: [man4ela | catapulta.eth]

Last updated at date: 15 May 2024

System Requirements

CPU

OS

RAM

DISK

A fast CPU with 4+ cores

Ubuntu 22.04

16GB+

>= 1.5TB

Note: The Linea archive node consumes 1.5 TB of space on May 14.2024

πŸ”² Linea

Pre-requisites

Update, upgrade, and clean the system, and then firewall management (ufw), Docker, and the Git version control system.

sudo apt update -y && sudo apt upgrade -y && sudo apt auto-remove -y
sudo apt install docker.io docker-compose git ufw -y

Set explicit default UFW rules

sudo ufw default deny incoming
sudo ufw default allow outgoing

Allow SSH, HTTP and HTTPS

sudo ufw allow 22/tcp
sudo ufw allow 80
sudo ufw allow 443

Enable Firewall

Setting up a domain name to access RPC

Get the IP address of the host machine, you can use the following command in a terminal or command prompt

Set an A record for a domain, you need to access the domain's DNS settings and create an A record that points to the IP address of the host machine. This configuration allows users to reach your domain by resolving the domain name to the specific IP address associated with your host machine.

Create Linea directory

The first command, mkdir Linea, will create a new directory named Linea in the current location. The second command, cd Linea, will change your current working directory to the newly created base directory. Now you are inside the base directory and can start storing docker-compose and related files in it.

Create .env file

Paste the following into the file.

ctrl + x and y to save file

Make configuration directory

Download genesis.json

Create docker-compose.yml

Return to Linea directory

Create and paste the following into the docker-compose.yml

ctrl + x and y to save file

Run Linea Node

Monitor Logs

Use docker logs to monitor your Linea node. The -f flag ensures you are following the log output

Allow a few minutes for the Linea node to connect with peers. Once it starts syncing, the logs should look like this:

Test Linea RPC

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)

Last updated