Skip to content

Latest commit

 

History

History
89 lines (64 loc) · 3.04 KB

RUN_INSTRUCTIONS.md

File metadata and controls

89 lines (64 loc) · 3.04 KB

Run Instructions for meta-dao

Introduction

This document provides detailed run instructions for building the program and running tests (at least). It includes steps to set up the environment and handle common issues and gotchas.

Prerequisites

  • Rust (version rustc 1.73.0)
  • Solana (version 1.16.18)
  • Node.js (latest stable version)
  • Yarn (latest stable version)
  • Anchor (follow instructions from the Anchor documentation)

Environment Setup

Rust Installation

  1. Download and install rustup by running:
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Follow the on-screen instructions to complete the installation.
  3. After installation, install the specific Rust version (rustc 1.73.0):
    rustup install 1.73.0
    rustup default 1.73.0

Solana Installation

  1. Install Solana using the solana-install tool:
    sh -c "$(curl -sSfL https://release.solana.com/v1.16.18/install)"
  2. Add Solana to your PATH following the instructions provided at the end of the installation process.

Node.js and Yarn Installation

  1. Install Node.js from Node.js official website or use a version manager like nvm.
  2. Install Yarn globally using npm:
    npm install -g yarn

Anchor Installation

  1. Follow the detailed installation instructions for Anchor provided in the Anchor documentation.

Solana-verify Installation (optional)

  1. install cargo if you don't already have it:
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Install solana-verifiable-build using cargo:
    cargo install solana-verify

Installation Steps

After setting up the environment and installing all prerequisites, run the following commands in your project directory:

  1. Build the project using Anchor:
    anchor build
  2. Run tests with Anchor:
    anchor test

Common Issues and Troubleshooting

  • If you encounter any issues with version mismatches, ensure that the installed versions match the required versions listed in the prerequisites.
  • For any errors related to dependencies, try running yarn install in the project directory to ensure all necessary packages are installed.

Gotchas

  • You have the latest rustc version istalled but anchor build still complains that you have an old rust version installed... something like this (below). This means you need to update your solana version as documented above.
error: package regex-automata v0.4.3 cannot be built because it requires rustc 1.65 or newer, while the currently active rustc version is 1.62.0-dev

Run Tests

  1. Install dependencies in root and sdk sub directory:
    yarn install
    (cd sdk && yarn install)
  2. Run all tests with anchor:
    anchor test
  3. Run a specific test in the test.sh shell script:
    ./test.sh <test_name>