The setup.sh script is designed to automate the installation of all nine specialized toolchains and their dependencies required for the LAGOS framework. It uses a "robust mode" which handles paths, environment variables, and safe fallbacks.
This document breaks down the 13 automated steps executed by the script.
Installs common build tools and system-level libraries via apt-get required for compiling downstream languages. This includes build-essential, curl, git, libssl-dev, cmake, and clang.
Installs Rust using rustup. Rust is a critical prerequisite because several of the core toolchains (like Sui, Lurk, Clarinet, and Noir) are written in Rust or require Cargo to build properly.
Installs Erlang via apt-get. The BEAM virtual machine and OTP framework are strict requirements for running Gleam applications, which powers the LAGOS Federation Supervisor.
Installs ponyup, the official toolchain multiplexer for the Pony language. The script subsequently uses it to install and update ponyc (the compiler) and corral (the dependency manager).
Downloads a pre-compiled musl-based release of the Gleam compiler (v1.15.4) from its official GitHub repository, extracting and placing it in your ~/.local/bin directory.
Installs the Sui CLI using the suiup installer. After installation, the script also runs sui move build against the contracts/move directory to verify the toolchain is working correctly and to pre-compile the LAGOS governance contracts.
Downloads the pre-compiled binary release of Clarinet. Clarinet is a dedicated local development environment and testing harness for Clarity smart contracts.
Installs noirup and subsequently nargo (Noir's package manager and build tool). This toolchain is used for writing circuits in Noir and generating zero-knowledge proofs.
Installs Scarb via its official installation script. Scarb acts as the build toolchain and package manager for the Cairo language.
Lurk installation requires a specialized build process. The script attempts a hybrid approach:
- First, it checks for a pre-existing local binary.
- If missing but Docker is available, it uses Docker to compile the binary against a stable Debian environment (avoiding local C++ toolchain conflicts) and extracts the
lurkbinary to your host machine.
Downloads the latest nightly build of the Roc language compiler directly from its GitHub release page and installs it to the ~/roc directory.
Downloads the latest Linux release of the Unison Codebase Manager (ucm), which is used for compiling and executing Unison code, storing it in ~/unison.
Checks for an active Docker installation and automatically spins up a NATS server container (lagos-nats running nats:latest) on port 4222. This is required for the local cross-domain signaling orchestrated by the Gleam federation module.
At the end of its execution, the script runs a final verification loop to ensure the following commands are accessible in your terminal:
ponyc, gleam, sui, clarinet, nargo, scarb, roc, ucm, and lurk.
Note: Unless you run the script using
source setup.sh, the PATH updates are written directly to your~/.bashrc. You will need to either restart your terminal session or manually runsource ~/.bashrcto make the commands available in your current window.