> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skale.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Sync Node

> Guide to running a SKALE Network Sync Node

The Full-Sync Node is an available software implementation of a read-only SKALE Node that can help decrease the load on the core nodes of your chain.

Applications are commonly read-heavy compared to writes, meaning they pull data from the chain more often than push them. For applications that contain many reads, a full-sync node can help increase chain stability and speed by reducing the number of actions the core nodes on the chain must do, leaving them with a more extraordinary ability to handle transactions.

## General Steps

* Provision a machine
* Notify core team of IP/IPs range (`x.x.x.x:x.x.x.x`) and SKALE Chain for full-sync.
* Complete Full Sync setup

## Node Machine Requirements

* A Linux x86\_64 machine
* Ubuntu 22.04
* 8 vCPUs
* 16GB RAM
* 100GB root storage
* 256GB attached storage for MEDIUM chain
* 2TB attached storage for LARGE chain

## Node Network Requirements

* Ports 80, 443, 3009, and 10000–18192, and ICMP IPv4 shouldn't be closed by external firewall

## Node Software Prerequisites

* 16GB Swap
* docker
* docker-compose → 1.27.4
* iptables-persistent, btrfs-progs, lsof, lvm2, psmisc, and apt packages

## From Fresh Machine

```shell theme={null}
sudo apt-get update

# Install Docker and Docker-compose
sudo apt-get install docker.io
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# Install other dependencies
sudo apt install iptables-persistent btrfs-progs lsof lvm2 psmisc

# Setup Swapfile
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
```

<Note>
  Before proceeding, notify the core team of the IP address of your full-sync node. It's suggested to use an elastic IP for the whitelisted IP address.
</Note>

## Installation

<Steps>
  1. ##### Download sync-node-cli tool
     ```shell theme={null}
     VERSION_NUM=2.6.2 && sudo -E bash -c "curl -L https://github.com/skalenetwork/node-cli/releases/download/$VERSION_NUM/skale-$VERSION_NUM-`uname -s`-`uname -m`-sync >  /usr/local/bin/skale"
     ```

  2. ##### Apply executable permissions to the downloaded binary:
     ```shell theme={null}
     chmod +x /usr/local/bin/skale
     ```

  3. ##### Test the installation
     ```shell theme={null}
     skale --help
     ```

  4. ##### Prepare `.env` file:

     ```bash theme={null}
     CONTAINER_CONFIGS_STREAM="4.0.1"
     ENFORCE_BTRFS=True/False
     ENDPOINT=[[By Validator], YOUR GETH/INFURA ENDPOINT]
     MANAGER_CONTRACTS_ABI_URL="https://raw.githubusercontent.com/skalenetwork/concepts/refs/heads/master/releases/mainnet/skale-manager/1.12.0/skale-manager-1.12.0-mainnet-abi.json"
     IMA_CONTRACTS_ABI_URL="https://raw.githubusercontent.com/skalenetwork/concepts/refs/heads/master/releases/mainnet/IMA/2.2.0/mainnet/abi.json"
     DISK_MOUNTPOINT=[[By Validator], your attached storage /dev/sda or /dev/xvdd (this is an example. You just need to use your 2TB block device)]
     DOCKER_LVMPY_STREAM="1.0.2-stable.0"
     ENV_TYPE="mainnet"

     SCHAIN_NAME=[[By Validator], SKALE Chain NAME FOR YOUR SYNC NODE]
     ```

       <Warning>
         ENFORCE\_BTRFS=True formats your attached device as btrfs even if there is another filesystem. Backup the storage before running the command.
       </Warning>

  5. ##### Init sync node:
     ```shell theme={null}
     skale sync-node init [ENV_FILE_PATH]
     ```

  6. ##### Wait until your sync node will be inited

  7. ##### After the node is successfully inited, wait until `skaled` will download the snapshot and starts catchup blocks (usually 15–30 minutes)
</Steps>

### Setup SSL certs

Node SSL certificates support secure communication with SKALE Chain endpoints. By default, each node of a SKALE Chain listens on HTTP and WS ports. If SSL certs exist on the node, then HTTPS and WSS ports are also turned on.

To upload SSL certs to the node run:

```shell theme={null}
skale ssl upload -c $PATH_TO_CERT_FILE -k $PATH_TO_KEY_FILE
```

To check the status of your certs run:

```shell theme={null}
skale ssl status
```

Once certs are uploaded, HTTPS/WSS endpoints should become available for your chain.

### Full sync node update

Update full sync SKALE node on current machine

```shell theme={null}
skale sync-node update [ENV_FILEPATH]
```

Options:

* `--yes` - update without additional confirmation

Arguments:

* `ENV_FILEPATH` - path to env file where parameters are defined

<Note>
  You can just update a file with environment variables used during `skale sync-node init`.
</Note>

### Maintenance

Maintenance commands are not available for a sync node.
