> For the complete documentation index, see [llms.txt](https://uthersunlighter.gitbook.io/uthersunlighter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://uthersunlighter.gitbook.io/uthersunlighter/aligned-layer.md).

# Aligned Layer

### System Requirements

| Requirement          | Specification                                    |
| -------------------- | ------------------------------------------------ |
| **Operating System** | Linux (Ubuntu 20.04 or later)                    |
| **CPU**              | 2 cores or more                                  |
| **RAM**              | Minimum 4 GB                                     |
| **Disk Space**       | At least 20 GB of free space                     |
| **Network**          | Stable internet connection                       |
| **VPS**              | Recommended VPS with at least 1 CPU and 2 GB RAM |

### Installing Aligned Layer Node

#### Step 1: Update Your System

Open your terminal and run the following commands to update your system packages:

```bash
sudo apt update -y
sudo apt upgrade -y
```

#### Step 2: Install Required Dependencies

Ensure that you have `curl` and other necessary tools installed:

```bash
sudo apt-get install curl git build-essential -y
```

#### Step 3: Install Go

Download and install Go. As of this writing, the latest version is 1.20. If the version has changed, check the [official Go website](https://golang.org/dl/) for the latest version.

```bash
wget https://golang.org/dl/go1.20.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
```

Add Go to your environment variables:

```bash
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
source ~/.profile
```

#### Step 4: Clone the Aligned Layer Repository

Now clone the Aligned Layer repository:

```bash
git clone https://github.com/yetanotherco/aligned_layer.git
cd aligned_layer
```

#### Step 5: Build the Node

Navigate to the node directory and build the project:

```bash
cd batcher/aligned/
go build .
```

#### Step 6: Initialize the Node

Initialize your node by setting a node name:

```bash
./aligned init <node_name>
```

Replace `<node_name>` with your desired name.

#### Step 7: Download Genesis and Addrbook Files

Download the necessary files for synchronization:

```bash
curl -o ~/.aligned/genesis.json https://example.com/path/to/genesis.json
curl -o ~/.aligned/addrbook.json https://example.com/path/to/addrbook.json
```

(Replace the URLs with actual links to the genesis and addrbook files).

#### Step 8: Start the Node

Start your node using the following command:

```bash
./aligned start
```

#### Step 9: Set Up Auto-Start (Optional)

To ensure your node automatically restarts on failure, create a systemd service:

```bash
sudo nano /etc/systemd/system/aligned.service
```

Add the following code to the file:

```ini
[Unit]
Description=Aligned Layer Node

[Service]
User=<your_username>
ExecStart=/path/to/aligned start
Restart=always

[Install]
WantedBy=multi-user.target
```

Replace `<your_username>` with your username and `/path/to/aligned` with the path to your executable file.

Save the file and run the following commands to activate the service:

```bash
sudo systemctl daemon-reload
sudo systemctl enable aligned.service
sudo systemctl start aligned.service
```

### Check Node Status

To check the status of your node, use this command:

```bash
sudo systemctl status aligned.service
```
