Run a Validator

GenLayer Validator Requirements

Running a GenLayer Validator node ensures the security and reliability of the GenLayer network. Below are the requirements for running a GenLayer validator.

Dependencies

LLM Access

Each validator needs access to a Large Language Model (LLM) for executing and evaluating Intelligent Contracts.

It is up to each validator to select the model they want to use.

Possible options:

  • Run an open-source model locally on the same machine with a GPU
  • Run an open-source model on a different machine
  • Connect to a hosted inference provider (OpenAI, Anthropic, Heurist, Atoma network etc.)

ZKSync Full Node for the GenLayer Chain

Each validator needs access to a ZKSync Full Node (opens in a new tab) connected to the GenLayer chain.

One full node can be shared between multiple validators - TBD how many exactly.

System Requirements

Below are the initial recommended system requirements. These guidelines may change as the network grows and evolves.

RAM

  • Recommended: 16 GB
  • Why:
    • GenLayer's genvm can spawn multiple Sub-VMs for contract calls and non-deterministic blocks.
    • Each Sub-VM can consume up to ~4 GB of RAM for storage.

CPU

  • Recommended: Modern multi-core processor with at least 8 cores/16 threads

Storage

  • Recommended Disk Space: 128 GB+
  • Preferred Type: SSD or NVMe (M.2)

Network

  • Recommended Connection: Stable broadband

Operating System

  • Recommended: 64-bit Linux (Ubuntu, Debian, CentOS, etc.)

Architecture

  • Recommended: AMD64
  • ARM64 support will come in the future

GPU (Optional)

  • Recommended: If you plan to run advanced AI-models locally, a CUDA-compatible GPU could be beneficial.
⚠️

These requirements are a starting point. As GenLayer evolves and usage patterns change (e.g., more complex AI-driven Intelligent Contracts), the recommended hardware may change.

Setup

  1. Decide on the version of the node you want to run by checking the available packages
    curl "https://storage.googleapis.com/storage/v1/b/gh-af/o?prefix=genlayer-node/bin/amd64"
  2. Download the packaged application
    export version=v0.0.0-test018 # set your desired version here
    wget https://storage.googleapis.com/gh-af/genlayer-node/bin/amd64/${version}/genlayer-node-linux-amd64-${version}.tar.gz
  3. Extract it
    tar -xzvf genlayer-node-linux-amd64-${version}.tar.gz
  4. cd into it
    cd genlayer-node-linux-amd64
  5. Configure configs/node/config.yaml
  6. Configure configs/node/wallet.yaml
  7. Configure GenVM
  8. Run the node
    export OPENAIKEY='sk-proj-fill-in-your-openai-key' # export all the necessary environment variables for the GenVM
    ./bin/genlayernode

Config

config.yaml

datadir: "./data/node" # Cache directory
logging:
  level: "INFO" # Log level
node:
  rpc:
    port: 9151 # JSON RPC port
    endpoints:
      groups:
        ethereum: true # Enable Ethereum RPC endpoints
        debug: false # Enable debug endpoints
      methods: # Enabled `eth_` methods
        eth_blockNumber: true
        eth_getBlockByNumber: true
        eth_getBlockByHash: true
        eth_sendRawTransaction: false
  ops:
    port: 9153 # Metrics port
    endpoints:
      metrics: true # Enable metrics endpoint
      health: true # Enable health endpoint
  dev: # Configuration for development purposes
    disableSubscription: false # Disable subscription
rollup:
  zksyncurl: "https://genlayer-testnet.rpc.caldera.xyz/http" # ZKSync RPC URL
  zksyncwebsocketurl: "wss://genlayer-testnet.rpc.caldera.xyz/ws" # ZKSync WebSocket URL
consensus:
  contractmainaddress: "0x..." # ConsensusMain Smart Contract Address
  contractdataaddress: "0x..." # ConsensusData Smart Contract Address
  contractmanageraddress: "0x..." # ConsensusManager Smart Contract Address
 
# Advanced configuration
merkleforest:
  maxdepth: 16
  dbpath: "./data/node/merkle/forest/data.db"
  indexdbpath: "./data/node/merkle/index.db"
merkletree:
  maxdepth: 16
  dbpath: "./data/node/merkle/tree/"
genvm:
  presets:
    - name: "preset_1"
      enabled: true
      type: "local"
  instances:
    - name: "genvm_local_1"
      usePreset: "preset_1"
      enabled: true
      type: "local"
      execution:
        timeout: 30s
      executable: "./third_party/genvm/bin/genvm"
      tempDir: "./tmp/genvm/genvm_local_1"

wallet.yaml

wallet:
  consensusAddress: "0xbf064d3e04309730153be69ff01713a22E795718" # Public address of your validator to use
  accounts: # List of possible accounts to use
    "0xbf064d3e04309730153be69ff01713a22E795718": # Public address of your validator to use
      privateKey: "0xdc9e4c3fd72879b7797223405728c7dcef8e118591c5b931270d6060c49012a0" # Private Key of the account
      password: "whateveryouwant" # Password for locking the account

GenVM

You can configure the GenVM in third_party/genvm/share/genvm/default-config.json. The json schema will guide you on how to configure each field.

Default config

{
  "$schema": "https://raw.githubusercontent.com/yeagerai/genvm/refs/heads/main/doc/schemas/default-config.json",
  "modules": {
    "llm": {
      "config": {
        "host": "https://api.openai.com",
        "provider": "openai-compatible",
        "model": "gpt-4o-mini",
        "key_env_name": "OPENAIKEY"
      }
    },
    "web": {
      "config": {
        "host": "http://127.0.0.1:4444"
      }
    }
  }
}