# 1. Prepare the environment

1. **Clone the Repository**

Clone the repository to your local machine:

```
git clone https://github.com/fiamma-chain/operator_for_linux.git
cd operator_for_linux
```

***

2. **Prepare the Environment**

Run the setup script to install all dependencies and prepare your environment:

```
./setup.sh
```

**Important:** After the first execution of `setup.sh`, you need to enable the Rust environment variables:

```
source "$HOME/.cargo/env"
```

Alternatively, you can restart your terminal or run:

```
source ~/.bashrc
# or if you're using zsh:
source ~/.zshrc
```

**This script will:**

* Install required packages (build-essential, gcc, g++, libssl-dev)
* Install and configure PostgreSQL
* Install Docker and Docker Compose (if not already installed)
* Install Rust and SQLx CLI
* Create a default .env file from .env\_example
* Start database and Redis containers
* Set **execute permissions** on scripts

***

3. **Database Setup**

Run database migrations to set up the required database schema:

```
cd dal && cp .env.example .env && sqlx migrate run && cd ..
```
