Module 1 - Preparing Configuration & Basic Setup
In this module, we’ll prepare the configuration for your L2 and set up the basic environment needed to get started.
Step 1: Prepare Your Configuration
Section titled “Step 1: Prepare Your Configuration”Before setting up your L2, you need to decide on a few key parameters:
-
Choose a Chain ID that uniquely identifies your chain (will be used for MetaMask setup later)
- Example:
1002
- Example:
-
Select a Genesis Address that will receive the initial token supply
- Example:
0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2
- Example:
-
Determine the Genesis Balance (initial token supply)
- Example:
1000000000000000000000000
- Example:
Step 2: Download Required Repositories
Section titled “Step 2: Download Required Repositories”Clone the Rome setup repository:
git clone --branch v0.3.0 --single-branch https://github.com/rome-labs/rome-setup.git
Step 3: Install Docker Images
Section titled “Step 3: Install Docker Images”For Ubuntu Users
Section titled “For Ubuntu Users”If you’re using Ubuntu, you can directly pull the pre-built Docker images:
docker pull romelabs/rollup-op-geth:v0.3.0docker pull romelabs/rome-apps:v0.3.0docker pull romelabs/rome-evm:v0.3.0
For Non-Ubuntu Users
Section titled “For Non-Ubuntu Users”If you’re not using Ubuntu, you’ll need to build the Docker images locally:
# Clone required repositoriesgit clone --branch v0.3.0 https://github.com/rome-labs/rome-apps.gitgit clone --branch v0.3.0 https://github.com/rome-labs/rome-sdk.gitgit clone --branch v0.3.0 https://github.com/rome-labs/rome-evm.git
# Build the rome-apps imagedocker buildx build -t romelabs/rome-apps:v0.3.0 -f rome-apps/docker/Dockerfile .
For the OP Geth image:
# Clone required repositoriesgit clone --branch v0.3.0 https://github.com/rome-labs/rome-rollup-clients.gitgit clone --branch v0.3.0 https://github.com/rome-labs/op-geth.git
# Build the OP Geth imagedocker buildx build -t romelabs/rollup-op-geth:v0.3.0 -f ./rome-rollup-clients/op-geth/Dockerfile .
Step 4: Create Dockerfile for Non-Ubuntu Users
Section titled “Step 4: Create Dockerfile for Non-Ubuntu Users”If you’re not using Ubuntu, you’ll need to create a Dockerfile in the rome-rollup-clients/op-geth
directory:
FROM --platform=$BUILDPLATFORM golang:1.21.6-alpine AS builder
WORKDIR /app
# Install build dependenciesRUN apk add --no-cache git make gcc musl-dev linux-headers
# Set up cross-compilationENV GOOS=linuxENV GOARCH=amd64ENV CGO_ENABLED=0
COPY ../../op-geth /app/op-gethRUN cd op-geth && make geth
FROM --platform=$TARGETPLATFORM nginx:alpine AS run
WORKDIR /app
ENV GETH_NAME="op-geth"ENV HTTP_PORT="8545"ENV ENGINE_PORT="8551"ENV DISCOVERY_PORT="30303"ENV GETH_BINARY="/usr/local/bin/geth"ENV GETH_BASE_DATA_DIR="/app/.ethereum"ENV PORT="3000"
# Install bash, OpenSSL, Node.js, and ts-nodeRUN apk add --no-cache bash openssl nodejs npm
# Copy the Geth binary, Nginx configuration, SSL generation script, and other necessary filesCOPY --from=builder /app/op-geth/build/bin/geth /usr/local/bin/geth
COPY rome-rollup-clients/op-geth/scripts scriptsCOPY rome-rollup-clients/op-geth/nginx.conf /etc/nginx/nginx.confCOPY rome-rollup-clients/op-geth/run.sh ./run.sh
# Expose ports for Nginx and Express serverEXPOSE 80EXPOSE 443
# Start Geth, Nginx, and the Express server using ts-nodeCMD ["bash", "./run.sh"]