Optimism Baremetal Guide

System Requirements

CPU
OS
RAM
Disk

4c/8T

Ubuntu 22.04

>= 16GB

>= 8TB

πŸ”΄ Optimism

Official Docs https://community.optimism.io/docs/developers/bedrock/node-operator-guide/#arrow-up-right

Pre-requisites

sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y

sudo apt install -y git make wget gcc pkg-config libusb-1.0-0-dev libudev-dev jq gcc g++ curl libssl-dev apache2-utils build-essential pkg-config 

# Add to PATH
echo "export PATH="$PATH:/root/.foundry/bin:/usr/local/go/bin:/root/.local/bin"" >> /root/.bashrc

source /root/.bashrc

# Install go
sudo wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz && rm go1.21.6.linux-amd64.tar.gz

# Install nvm
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash 

# Download foundry
curl -L https://foundry.paradigm.xyz | bash

# Install foundry
foundryup

source /root/.bashrc

# Install node and yarn
nvm install 16 && npm install --global yarn && nvm use 16 && npm -g install pnpm

source /root/.bashrc

# Check if go and npm are installed:
go version
nvm -v
npm -v
yarn -v
pnpm -v

# Create directories
mkdir -p /root/github
mkdir -p /root/data/optimism/geth/dtl
mkdir -p /root/data/optimism/geth/l2geth
mkdir -p /root/data/optimism/geth/op-node
mkdir -p /root/data/optimism/geth/op-geth

# Download snapshots
https://docs.optimism.io/builders/node-operators/management/snapshots#op-mainnet

# Verify tree structure
/root/data/optimism/geth ❯ tree -d
.
|-- dtl
|-- l2geth
|   |-- geth
|   |   |-- chaindata
|   |   |   `-- ancient
|   |   |-- chaindata-part1
|   |   |   `-- ancient
|   |   |-- chaindata-part2
|   |   |-- lightchaindata
|   |   `-- nodes
|   `-- keystore
|-- op-geth
|   |-- geth
|   |   |-- blobpool
|   |   |-- chaindata
|   |   |   `-- ancient
|   |   |-- nodes
|   |   `-- triecache
|   `-- keystore
`-- op-node
    |-- opnode_discovery_db
    `-- opnode_peerstore_db

22 directories

DTL

Building Optimism DTL

Setting up the Systemd file for DTL

Run DTL

Viewing Logs

To verify that DTL is running correctly you can run a command

If synchronizing from L1:

If synchronizing from L2:

It gives you the current transaction index, which should increase with time.

L2-GETH

Building and preparing L2 GETH

Setting up the Systemd file for L2GETH

Run L2GETH

Viewing Logs

To check if l2geth is running correctly, open another command line window and run these commands:

Wait a few seconds and then look at the blocknumber again and exit:

If L2 GETH is synchronizing, the second block number is higher than the first.

OP NODE

Setting up the Systemd file for OP Node

Run OP-NODE

Viewing Logs

OP-GETH

Building and preparing OP-GETH

Setting up the Systemd file for OP GETH

Run OP-GETH

Viewing Logs

Last updated