# Installation Instructions for macOS

### Installation Steps

Follow these steps to set up the CLI node on macOS:

1. Install Node.js 23+:
   * Ensure you have Node.js version 23 or higher, required for the validator script.
   * Using Homebrew (Recommended):
     * Install Homebrew if not already present:

       ```bash
       /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
       ```
     * Install Node.js 23:bash

       ```bash
       brew install node@23
       ```
     * Verify the installation:bash

       ```bash
       node -v
       ```

       Expected output should be v23.x.x or higher. If not, link the version:

       ```bash
       brew link node@23 --force
       ```
   * Alternative Manual Installation:
     * Download the Node.js 23.x binary from [nodejs.org](https://nodejs.org/dist/v23.x.x/node-v23.x.x-darwin-x64.tar.gz) and extract it.
     * Move it to a system path (e.g., /usr/local/bin):

       ```bash
       sudo tar -xzf node-v23.x.x-darwin-x64.tar.gz -C /usr/local --strip-components=1
       ```
     * Verify with node -v.
2. Clone the Repository:
   * Open a Terminal and clone the validator repository:

     ```bash
     git clone https://github.com/ShadowNetworkXYZ/validator.git
     ```
   * Navigate to the cloned directory:

     ```bash
     cd validator
     ```
3. Configure Environment Variables:
   * Copy the example environment file to create a custom configuration:

     ```bash
     cp .env.example .env
     ```
   * Edit .env with a text editor (e.g., nano or code) to set required variables, such as NODE\_ID or API endpoints, as per the project documentation.
4. Install Dependencies:
   * Run the following command to install all necessary Node.js packages:

     ```bash
     npm install
     ```
5. Launch the Node:
   * Start the validator script with:

     ```bash
     node validator
     ```
6. Verify Operation:
   * Check the Terminal output for synchronization status, errors, or logs to ensure the node is running correctly.

### Troubleshooting

* Node.js Version: Verify your Node.js version with node -v. If below 23, reinstall using the steps above. Use nvm (Node Version Manager) as an alternative:

  ```bash
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  nvm install 23
  ```
* Permissions: If the script fails to run, adjust file permissions with chmod +x validator.js.
* Environment Variables: If the node fails to start due to missing configuration, double-check .env for all required fields.
* Firewall: Ensure your macOS firewall allows outgoing connections if the node struggles to sync with the network.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shadow-network.xyz/cli-node/markdown.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
