Build and Run Using Docker

Download L2geth

  1. Build the container using make mockccc_docker. This will produce the image scrolltech/l2geth:latest.

    Alternatively, you can download the l2geth Docker image using docker pull scrolltech/l2geth:scroll-v5.8.42(currently not supported arm64 architecture, if you runs on arm64 server, you can build it from source). In this case, substitute this image name in the commands below.

Run L2geth

  1. Hardware specs - CPU: AWS t3.2xlarge (or equivalent); Disk: 4TB gp3 SSD.

    Currently the archive snapshot contains all the historical data, it’s nearly 2TB, if you download and unarchive it on one disk, it needs at least 4TB volume, or you can download it to EFS and unarchive it to EBS, not supoorts to run the geth datadir on EFS or other network storage. Geth node needs at least 16GB memory, and 4 cores of CPU. We recommond you run the geth node on AWS t3.2xlarge type.

  2. prepare the snapshot first

    for mpt nodes:

    SNAPSHOT_URL = https://snapshot.scroll.io/mpt/latest.tar

    mkdir l2geth-mpt && pushd l2geth-mpt
    wget $SNAPSHOT_URL 
    # unarchive the tar file
    tar -xf latest.tar
    popd
    
  3. Run the l2geth container by docker-compose, following is the compose file, you can run docker compose up -d to start the node.

    Note: for MPT nodes simply add --scroll-mpt flag to the command field in your docker-compose.yaml

    $ cat docker-compose.yaml
    ---
      version: "3"
    
      services:
        l2geth:
          image: scrolltech/l2geth:scroll-v5.10.6
          container_name: l2geth-docker
          stop_signal: SIGINT
          stop_grace_period: 60s
          restart: unless-stopped
    
          environment:
            CHAIN_ID: "534351"
            RUST_LOG: info
    
          volumes:
            - ./data:/volume/l2geth/data
    
          ports:
            - "8545:8545"
            - "8546:8546"
            - "30303:30303"
            - "30303:30303/udp"
    
          # MPT archive node
          command:
            - --scroll-sepolia
            - --scroll-mpt
            - --cache.noprefetch
            - --cache.snapshot=0
            - --snapshot=false
            - --datadir=/volume/l2geth/data
            - --gcmode=archive
            - --http
            - --http.addr=0.0.0.0
            - --http.port=8545
            - --http.api=eth,net,web3,debug,scroll
            - --l1.endpoint=https://eth-sepolia.g.alchemy.com/v2/xxx
            - --l1.confirmations=finalized
            - --l1.sync.startblock=4038000
            - --da.blob.awss3=https://scroll-sepolia-blob-data.s3.us-west-2.amazonaws.com/
            - --txpool.globalqueue=4096
            - --txpool.globalslots=40960
            - --rollup.verify
            - --verbosity=3
            - --log.debug
    
          logging:
            driver: json-file
            options:
              max-size: 100m
              max-file: "1"
    
  4. In a separate shell, you can now attach to l2geth.

    $ docker exec -it l2geth-docker geth attach "/volume/l2geth-datadir/geth.ipc"
    
    > admin.peers.length
    5
    
    > eth.blockNumber
    10000
    

Interacting with the L2geth Container