Skip to content

Quick Start

This tutorial will run you through on how to spin up a local OP Kailua devnet for development purposes.

Before you get started, you will need the following dependencies installed:

Clone the Kailua repo

git clone https://github.com/risc0/kailua.git && cd kailua

Run the following commands to spin up a devnet

You can deploy a local optimism devnet equipped with Kailua through the following commands:

  1. just devnet-fetch
    • Fetches v1.9.1 of the optimism monorepo.
  2. just devnet-build
    • Builds the local cargo and foundry projects.
  3. just devnet-up
    • Starts a local OP Stack devnet using docker.
    • Dumps the output into devnetlog.txt for inspection.
  4. just devnet-upgrade
    • Upgrades the devnet to use the KailuaGame contract.
    • Assumes the default values of the local optimism devnet, but can take parameters.
  5. just devnet-propose
    • Launches the Kailua proposer.
    • This runs the sequences, which periodically creates new KailuaGame instances.
  6. just devnet-validate
    • Launches the Kailua validator.
    • This monitors KailuaGame instances for disputes and creates proofs to resolve them.
    • (VALIDITY PROVING) Use just devnet-validate [block-height] to generate validity proofs to fast-forward finality until the specified L2 block height.
    • (DEVELOPMENT MODE): Use RISC0_DEV_MODE=1 to use fake proofs.
  7. just devnet-fault
    • Deploys a single KailuaGame instance with a faulty sequencing proposal.
    • Tests the validator's fault proving functionality.
    • Tests the proposer's canonical chain tracking functionality.
  8. After you're done:
    • just devnet-down to stop the running docker containers.
    • just devnet-clean to cleanup the docker volumes.