Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions thornodes/fullnode/thornode-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Install all packages needed for running and configuring the THORNode container
apt install -y --no-install-recommends aria2 curl docker.io jq pv
```

{% hint style="info" %}
The published image is built for `linux/amd64`. On an `arm64` host (e.g. Apple Silicon) add `--platform linux/amd64` to the `docker run` command to run it under emulation.
{% endhint %}

## Configuration

### Work directory
Expand All @@ -30,31 +34,46 @@ mkdir -p /opt/thornode/.thornode/config

### Genesis

For joining the network, the correct genesis file is required.
No manual step is required. On first start the container fetches the genesis file automatically from the network's seed nodes (discovered via the configured seed-nodes endpoint, then pulled from a peer's RPC). A successful genesis fetch is **not** by itself enough to join the network — you must also choose a sync method below, otherwise the node will attempt to initialize from the fetched genesis and fail.

### Sync

A fullnode cannot replay the chain from genesis with a current binary; you must bootstrap from a recent state. Choose one of the following.

#### Option A — Automatic StateSync (self-contained)

Set `THOR_AUTO_STATE_SYNC_ENABLED=true` (included in the `docker run` below). The node determines a trust height from the default trusted RPC servers and restores recent state over P2P from StateSync peers.

{% hint style="warning" %}
Nine Realms infrastructure has been decommissioned. Refer to the upstream [node-launcher documentation](https://gitlab.com/thorchain/devops/node-launcher/-/tree/master/docs) for the current genesis file source.
Network StateSync is memory intensive — at the time of writing it requires roughly `80 GB` of RAM. Ensure your server is sized accordingly.
{% endhint %}

### Sync
#### Option B — Snapshot restore

The fastest way to join the network is by downloading a current snapshot and syncing from it.
Download a current snapshot and extract it into `/opt/thornode/.thornode/data` before starting the container (leave `THOR_AUTO_STATE_SYNC_ENABLED` unset in this case). For snapshot sources and the recovery procedure, see the upstream [Thornode Snapshot Recovery and Storage Management](https://gitlab.com/thorchain/devops/node-launcher/-/blob/master/docs/Thornode-Snapshot-Recovery-and-Storage-Management.md) doc.

{% hint style="warning" %}
Nine Realms infrastructure has been decommissioned. Refer to the upstream [Thornode Snapshot Recovery and Storage Management](https://gitlab.com/thorchain/devops/node-launcher/-/blob/master/docs/Thornode-Snapshot-Recovery-and-Storage-Management.md) doc for the current snapshot source and recovery procedure.
{% hint style="info" %}
That document is written for the Kubernetes/Helm `node-launcher` deployment (it uses `make` targets); for a standalone Docker node use it only as the source of the snapshot location and storage guidance, and place the extracted data under the mounted `.thornode/data` directory.
{% endhint %}

## Start

Use the image tag that matches the current network version (check `/thorchain/version` on a public node). At the time of writing this is `mainnet-3.18.1`.

Start the thornode container

```sh
docker run -d --restart=on-failure \
-v /opt/thornode/.thornode:/root/.thornode \
-e CHAIN_ID=thorchain-1 \
-e THOR_AUTO_STATE_SYNC_ENABLED=true \
-p 127.0.0.1:1317:1317 \
-p 127.0.0.1:27147:27147 \
-p 27146:27146 \
--name thornode \
registry.gitlab.com/thorchain/thornode:mainnet-2.135.1
registry.gitlab.com/thorchain/thornode:mainnet-3.18.1
```

{% hint style="info" %}
On `arm64` hosts add `--platform linux/amd64`. If you bootstrapped via a snapshot (Option B) instead of StateSync, remove the `-e THOR_AUTO_STATE_SYNC_ENABLED=true` line.
{% endhint %}