> For the complete documentation index, see [llms.txt](https://docs.hipersnipe.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hipersnipe.com/for-operators/installation.md).

# Installation

For **bot operators** self-hosting HiperSnipe. Telegram users do not need this — open the bot and see [Welcome](/getting-started/welcome.md).

## Requirements

* Python **3.10+**
* Linux server recommended for production (Ubuntu 22.04+)
* A Telegram bot token from [@BotFather](https://t.me/BotFather)
* A Solana RPC provider (Helius recommended)

## Clone the repository

```bash
git clone https://github.com/enejac/HiperSnipeBot_Solana_Python.git
cd HiperSnipeBot_Solana_Python
```

## Virtual environment

```bash
python3 -m venv venv
source venv/bin/activate
```

Windows PowerShell:

```powershell
python -m venv venv
.\venv\Scripts\Activate.ps1
```

## Install dependencies

```bash
pip install -r requirements.txt
```

Key packages:

| Package              | Role                    |
| -------------------- | ----------------------- |
| `aiogram`            | Telegram Bot API        |
| `aiosqlite`          | Async SQLite            |
| `cryptography`       | Fernet key encryption   |
| `solders` / `solana` | Solana transactions     |
| `jupiter-python-sdk` | Jupiter swaps           |
| `telethon`           | TG CA Sniper (optional) |
| `python-dotenv`      | Environment loading     |

## Sensitive directories

| Path              | Purpose                                    |
| ----------------- | ------------------------------------------ |
| `.env`            | Secrets (never commit)                     |
| `secure_storage/` | `encryption.key` and optional key material |
| `users.db`        | Live user data (git-ignored)               |

On first run the bot can generate `secure_storage/encryption.key` if `ENCRYPTION_KEY` is not set in `.env`.

## Optional: TG CA Sniper session

If you plan to use the Telegram group sniper:

1. Get `TELEGRAM_API_ID` and `TELEGRAM_API_HASH` from [my.telegram.org](https://my.telegram.org/apps).
2. Run `python generate_session.py` to produce `TG_SESSION_STRING`.
3. Add the string to `.env`.

## Next steps

* [Configuration](/for-operators/configuration.md)
* [Running the bot](/for-operators/running-the-bot.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hipersnipe.com/for-operators/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
