Skip to content

Running Zeko's DA Node

A critical component of any rollup system is the data availability layer. This layer is responsible for storing all the transaction data that occurs on the rollup.

In this guide we will create a da-layer node that receives transaction data from the Zeko L2 rollup.

Not covered in this guide:

We will use docker compose to define the whole stack in a single file.

TL;DR skip to the Bootstrap process

Prerequisites

System Requirements

  • Linux or macOS (Windows WSL2 works too)
  • 1 CPU core, 2GB RAM

Note: Running da-layer node does not need much ram. However to sync the full history without using snapshots and database backups, more RAM will allow quicker initial sync.

Installed Software

  • Docker

Overview

Architecture

In the diagram above you see:

  • Zeko's sequencer sending transactions to da-layer
  • the optional archive stack that can index and serve historical data from your DA node

Project Structure

Layout of the project directory:

project-root/
└── docker-compose.yaml

Note: docker-compose.yaml is using docker volumes to store data. If you prefer to mount local directories instead - change accordingly.

Wallets

To run a da-layer you will need:

  • da-layer - Each da-layer node is started with its wallet.

Volumes/files

VolumesFilesPurpose
keys_datada-layer-skPrivate key of the DA node
keys_datada-layer-pkPublic key of the DA node (used by sequencer)
da-layer_dataPersistent storage for da-layer

Service Overview

  • init-config
  • da-layer

Ports Exposed

ServicePortDescription
da-layer1924da-layer rpc API

Bootstrap process

Getting/Creating configuration files

  • Copy docker-compose.yaml to your project folder.

    Click to expand docker-compose.yaml
    yaml
    services:
      init-config:
        image: docker.io/zekolabs/zeko:latest
        container_name: init-config
        working_dir: /data
        volumes:
          - keys_data:/data/keys
        entrypoint:
          - sh
          - -c
        restart: "no"
        command: >
          "while [ ! -f /data/keys/.keys_created ];
            do sleep 2;
          done; exit 0"
      da-layer:
        depends_on:
          init-config:
            condition: service_completed_successfully
        image: docker.io/zekolabs/zeko-da:latest
        container_name: da-layer
        ports:
          - "1924:1924"
        environment:
          ZEKO_SIGNATURE_KIND: "testnet"
        entrypoint: bash -c
        command: |
          "export MINA_PRIVATE_KEY=$(cat /keys/da-layer-sk) && \\
          exec zeko-da \\
          run-node \\
          --port 1924 \\
          --db-dir /data/db \\
          --network-id testnet"
        volumes:
          - da-layer_data:/data
          - keys_data:/keys:ro
        restart: always
    
    volumes:
      da-layer_data:
      keys_data:
  • Start all services

    bash
    docker compose up -d
  • Create da-layer keys

    1. Enter init-config container:
    bash
    docker compose exec -it init-config bash

    Note: This image contains zeko-cli binary.

    1. Create da-layer keypair
    • /data/keys/da-layer-pk
    • /data/keys/da-layer-sk

    Note: Take note of da-layer-pk

    bash
    # create `da-layer` keypair
    zeko-cli generate-even-key | while read label1 label2 value; do
    if [ "$label1" = "Private" ]; then
      echo "$value" > da-layer-sk
    elif [ "$label1" = "Public" ]; then
      echo "$value" > da-layer-pk
    fi
    done
    
    mv da-layer-{sk,pk} /data/keys
    touch /data/keys/.keys_created

If all the steps were performed correctly you have the following:

  • da-layer getting data from Zeko's L2

Let Zeko know about your DA Layer

In order for you to start receiving transactions from Zeko L2 sequencer you need to:

  • Expose your da-layer on the internet
  • Contact Zeko and ask to be added to DA node list. You will need to provide:
    • your da-layer public key
    • address:port on which Zeko's sequencer can reach your da-layer

Synchronizing the data

Once your DA node will be added to Zeko's Sequencer, your node will start receiving transactions. Synchronizing might take some time. It depends when did the sequencer receive a hard reset.

If you want to index that data and query it through an archive API, continue with Running Zeko's Archive Node.

Docs released under the MIT License.