|
| 1 | +# Run Instructions for meta-dao |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- Rust (version rustc 1.73.0) |
| 10 | +- Solana (version 1.16.18) |
| 11 | +- Node.js (latest stable version) |
| 12 | +- Yarn (latest stable version) |
| 13 | +- Anchor (follow instructions from the Anchor documentation) |
| 14 | + |
| 15 | +## Environment Setup |
| 16 | + |
| 17 | +### Rust Installation |
| 18 | + |
| 19 | +1. Download and install `rustup` by running: |
| 20 | + ```bash |
| 21 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| 22 | + ``` |
| 23 | +2. Follow the on-screen instructions to complete the installation. |
| 24 | +3. After installation, install the specific Rust version (rustc 1.73.0): |
| 25 | + ```bash |
| 26 | + rustup install 1.73.0 |
| 27 | + rustup default 1.73.0 |
| 28 | + ``` |
| 29 | + |
| 30 | +### Solana Installation |
| 31 | + |
| 32 | +1. Install Solana using the `solana-install` tool: |
| 33 | + <pre><code>sh -c "$(curl -sSfL https://release.solana.com/v1.16.18/install)"</code></pre> |
| 34 | +2. Add Solana to your PATH following the instructions provided at the end of the installation process. |
| 35 | + |
| 36 | +### Node.js and Yarn Installation |
| 37 | + |
| 38 | +1. Install Node.js from [Node.js official website](https://nodejs.org/) or use a version manager like `nvm`. |
| 39 | +2. Install Yarn globally using npm: |
| 40 | + <pre><code>npm install -g yarn</code></pre> |
| 41 | + |
| 42 | +### Anchor Installation |
| 43 | + |
| 44 | +1. Follow the detailed installation instructions for Anchor provided in the <a href="https://www.anchor-lang.com/docs/installation" target="_blank">Anchor documentation</a>. |
| 45 | + |
| 46 | +## Installation Steps |
| 47 | + |
| 48 | +After setting up the environment and installing all prerequisites, run the following commands in your project directory: |
| 49 | + |
| 50 | +1. Build the project using Anchor: |
| 51 | + <pre><code>anchor build</code></pre> |
| 52 | +2. Run tests with Anchor: |
| 53 | + <pre><code>anchor test</code></pre> |
| 54 | + |
| 55 | +## Common Issues and Troubleshooting |
| 56 | + |
| 57 | +- If you encounter any issues with version mismatches, ensure that the installed versions match the required versions listed in the prerequisites. |
| 58 | +- For any errors related to dependencies, try running `yarn install` in the project directory to ensure all necessary packages are installed. |
| 59 | + |
| 60 | +## Gotchas |
| 61 | + |
| 62 | +- 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. |
| 63 | + |
| 64 | +``` |
| 65 | +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 |
| 66 | +``` |
0 commit comments