# Litecoin Node

{% tabs %}
{% tab title="Docker" %}
{% hint style="success" %}
**Минимальные требования к серверу:**

* **Диск:** Не менее 300 GB SSD (NVMe).
* **Процессор:** Минимум 6 ядер.
* **Память:** 8 ГБ.
* **Программное обеспечение:** Необходимо наличие установленного Docker.
  {% endhint %}

#### Создаем окружение:

```bash
mkdir -p /nodes/ltc
```

```bash
cd /nodes/ltc
```

#### Создаем дерикторию с данными bitcoind:

```bash
mkdir litecoin_data
```

#### Создаем конфигурацию bitcoind:

```bash
nano litecoind.conf
```

{% code title="litecoind.conf" %}

```yaml
[main]
rpcallowip=0.0.0.0/0 # !ALLOWED IP!
rpcbind=0.0.0.0
rpcport=9332
rpcuser=YOUR_USER_NAME
rpcpassword=YOUR_PASSWORD
server=1
prune=4096 #4GB
datadir=/data/.litecoin
keypool=6000
```

{% endcode %}

#### Создаем docker-compose.yml

```bash
nano docker-compose.yml
```

{% code title="docker-compose.yml" %}

```yaml
x-logging:
  &default-logging
  driver: "json-file"
  options:
    max-file: "1"
    max-size: "500m"

services:
  litecoin:
    image: rg.boxexchanger.net/boxexchanger-utils/docker-litecoind:main
    container_name: litecoind
    volumes:
      - ./litecoin_data:/data/.litecoin
      - ./litecoin.conf:/data/litecoin.conf
    logging: *default-logging
    restart: unless-stopped
    stop_grace_period: 15m30s
    ports:
      - "9333:9333"
      - "127.0.0.1:9332:9332"
      - "127.0.0.1:29332:28332"
      - "127.0.0.1:29333:28333"
```

{% endcode %}

#### Запускаем bitcoind в docker:&#x20;

```bash
docker compose up -d
```

{% endtab %}
{% endtabs %}

### Открываем порт доступа

Создаем прокси с портов \
&#x20; \- localhost:9332 на порт **9233** для bitcoind rpc&#x20;

<details>

<summary>Настраиваем прокси на caddy</summary>

Устанавливаем caddy <https://caddyserver.com/docs/install>\
\
Документация подготовлена для операционной системы **Debian, Ubuntu**

```shell
apt install -y debian-keyring debian-archive-keyring apt-transport-https
```

```shell
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
```

```shell
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' |  tee /etc/apt/sources.list.d/caddy-stable.list
```

```shell
apt update
```

```shell
apt install caddy
```

конфигурируем caddy  для прокси \
9333 на порт 9333 для внешней сети&#x20;

```bash
nano /etc/caddy/Caddyfile
```

{% code title="/etc/caddy/Caddyfile" %}

```nginx

:9233 {
  handle_path /* {
    reverse_proxy 127.0.0.1:9332
  }
  respond 404
}

```

{% endcode %}

запускаем caddy

```bash
systemctl enable --now caddy
```

или перезагружаем если необходимо&#x20;

`systemctl restart caddy`

</details>

{% hint style="warning" %}
**Открытие порта для RPC:** Для доступа к RPC необходимо открыть порт 9233 в настройках фаервола для IP-адреса сервера, с которого будет происходить подключение.
{% endhint %}

### Доступы

**RPC:** `http://ip.host:9233/`


---

# 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://manual.boxexchanger.net/dlya-razrabotchikov/ustanovka-node/litecoin-node.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.
