From cae8bfea823b0ac5ce39007e9529589bc767633d Mon Sep 17 00:00:00 2001 From: Nolan Ngo Date: Wed, 21 Oct 2026 14:31:51 +0700 Subject: [PATCH] docs: download node snapshots from rpc.xdc.network/snapshots Replace the legacy download.xinfin.network / downloads.apothem.network snapshot URLs with the .tar.lz4 files at https://rpc.xdc.network/snapshots, extract them with lz4, and document the one-command downloader (including its telemetry). --- .../developers/node_operators/docker.md | 61 ++++++++++---- .../developers/node_operators/masternode.md | 84 ++++++++++++++----- 2 files changed, 109 insertions(+), 36 deletions(-) diff --git a/docs/xdcchain/developers/node_operators/docker.md b/docs/xdcchain/developers/node_operators/docker.md index 666cfd7b..2afc889e 100644 --- a/docs/xdcchain/developers/node_operators/docker.md +++ b/docs/xdcchain/developers/node_operators/docker.md @@ -84,27 +84,57 @@ The following steps are to expedite the syncing process of your node with the XD +**Option A: One-command downloader (recommended)** + +The official downloader asks you to choose the network (Mainnet or Testnet/Apothem) and node type (Full or Archive). It resumes automatically if the connection drops. Snapshot files are very large (400 GB to 2 TB+), so run it inside `tmux` or `screen`: +```bash +sudo apt install -y tmux lz4 +tmux new -s download +curl -fsSL https://rpc.xdc.network/download | bash +``` +To detach and leave the download running, press `Ctrl+B`, then `D`. To reattach later, run `tmux attach -t download`. + +Note: the downloader sends download statistics (start, completion or failure event, network, node type, download method, duration, size, speed and error code) to `https://rpc.xdc.network/telemetry`. Like any web request, this also exposes your server's IP address. If you prefer not to send them, use Option B. + +All available snapshots, with their block height and size, are listed at [https://rpc.xdc.network/snapshots](https://rpc.xdc.network/snapshots). + +**Option B: Manual download** + # Mainnet Snapshot **Bring down your node:** ```bash bash docker-down.sh ``` -**Remove the old xdchain file from the server** +**Remove any old snapshot file from the server** ```bash -rm -rf xdcchain.tar +rm -f mainnet_full_latest.tar.lz4 mainnet_archive_latest.tar.lz4 ``` **Download the snapshot** + +Full Node snapshot: ```bash -wget https://download.xinfin.network/xdcchain.tar +wget -c https://rpc.xdc.network/snapshots/mainnet/full/mainnet_full_latest.tar.lz4 ``` -**Unpack the xdcchain.tar file** + +Archive Node snapshot: ```bash -tar -xvzf xdcchain.tar +wget -c https://rpc.xdc.network/snapshots/mainnet/archive/mainnet_archive_latest.tar.lz4 ``` -**The unpacking will take some time, and it will look like this:** +If the download is interrupted, run the same `wget -c` command again to resume it. -![unpacking](../../img/unpacking.png) +**Unpack the snapshot file** (requires `lz4`; for an Archive Node, use `mainnet_archive_latest.tar.lz4`) +```bash +sudo apt install -y lz4 +lz4 -d -c mainnet_full_latest.tar.lz4 | tar -xvf - +``` +**The unpacking will take some time. It creates an `XDC` directory and lists files like this:** +``` +XDC/ +XDC/chaindata/ +XDC/chaindata/2359986.ldb +... +``` **The following command will move the xdcchain/XDC to xdcchain/XDC_backup** ```bash @@ -133,31 +163,34 @@ This command will bring your node up and it will start syncing to the network. O bash docker-down.sh ``` -**Remove the old xdchain file from the server** +**Remove any old snapshot file from the server** ```bash -rm -rf apothem.tar +rm -f testnet_full_latest.tar.lz4 testnet_archive_latest.tar.lz4 ``` **Download the snapshot** Full Node snapshot: ```bash -wget http://downloads.apothem.network/xdcchain.tar +wget -c https://rpc.xdc.network/snapshots/testnet/full/testnet_full_latest.tar.lz4 ``` Archive Node snapshot: ```bash -wget http://downloads.apothem.network/xdcchain_archive.tar +wget -c https://rpc.xdc.network/snapshots/testnet/archive/testnet_archive_latest.tar.lz4 ``` -**Unpack the apothem.tar file** +**Unpack the snapshot file** (requires `lz4`; for an Archive Node, use `testnet_archive_latest.tar.lz4`) ```bash -tar -xvzf apothem.tar +sudo apt install -y lz4 +lz4 -d -c testnet_full_latest.tar.lz4 | tar -xvf - ``` -**Move the xdcchain-testnet** +**Back up the old chain data and move the new `XDC` directory into xdcchain-testnet** ```bash +mv xdcchain-testnet/XDC xdcchain-testnet/XDC_backup mv XDC xdcchain-testnet +rm -rf xdcchain-testnet/XDC/nodekey ``` **Bring up the node** diff --git a/docs/xdcchain/developers/node_operators/masternode.md b/docs/xdcchain/developers/node_operators/masternode.md index a8026aeb..e5a2f970 100644 --- a/docs/xdcchain/developers/node_operators/masternode.md +++ b/docs/xdcchain/developers/node_operators/masternode.md @@ -468,19 +468,26 @@ After deleting the XDC folder, you can now proceed to download and apply the lat To download the XDC Network Mainnet snapshot, use the appropriate command based on the type of node you’re setting up: -- **For a Full Node (latest state only):** https://rpc.xdc.network/snapshots/mainnet/full/ - -- **For an Archive Node (complete history):** https://rpc.xdc.network/snapshots/mainnet/archive/ +- **For a Full Node (latest state only):** +```bash +wget -c https://rpc.xdc.network/snapshots/mainnet/full/mainnet_full_latest.tar.lz4 +``` -**Note: Snapshots are updated approximately every 20 days at https://rpc.xdc.network/snapshots/** +- **For an Archive Node (complete history):** +```bash +wget -c https://rpc.xdc.network/snapshots/mainnet/archive/mainnet_archive_latest.tar.lz4 +``` -![node-sync](../../img/installation4.png) +**Note: Snapshots are published regularly (roughly every 1M blocks). See [https://rpc.xdc.network/snapshots](https://rpc.xdc.network/snapshots) for the latest block height and size. Snapshot files are very large (Full ~840 GB, Archive ~2.6 TB), so run the download inside `tmux` or `screen`. If the download is interrupted, run the same `wget -c` command again to resume it.** -Once the xdc.tar file has been downloaded, extract the snapshot by running the following command: +Once the snapshot file has been downloaded, install `lz4` and extract the snapshot by running the following commands: +```bash +sudo apt install -y lz4 +lz4 -d -c mainnet_full_latest.tar.lz4 | tar -xvf - ``` -tar -xvzf xdc.tar -``` + +For an Archive Node, replace `mainnet_full_latest.tar.lz4` with `mainnet_archive_latest.tar.lz4`. This will unpack the archive and create the XDC directory containing the necessary blockchain data. @@ -510,27 +517,57 @@ The following steps are to expedite the syncing process of your node with the XD +**Option A: One-command downloader (recommended)** + +The official downloader asks you to choose the network (Mainnet or Testnet/Apothem) and node type (Full or Archive). It resumes automatically if the connection drops. Snapshot files are very large (400 GB to 2 TB+), so run it inside `tmux` or `screen`: +```bash +sudo apt install -y tmux lz4 +tmux new -s download +curl -fsSL https://rpc.xdc.network/download | bash +``` +To detach and leave the download running, press `Ctrl+B`, then `D`. To reattach later, run `tmux attach -t download`. + +Note: the downloader sends download statistics (start, completion or failure event, network, node type, download method, duration, size, speed and error code) to `https://rpc.xdc.network/telemetry`. Like any web request, this also exposes your server's IP address. If you prefer not to send them, use Option B. + +All available snapshots, with their block height and size, are listed at [https://rpc.xdc.network/snapshots](https://rpc.xdc.network/snapshots). + +**Option B: Manual download** + # Mainnet Snapshot **Bring down your node:** ```bash sudo docker-compose -f docker-compose.yml down ``` -**Remove the old xdchain file from the server** +**Remove any old snapshot file from the server** ```bash -rm -rf xdcchain.tar +rm -f mainnet_full_latest.tar.lz4 mainnet_archive_latest.tar.lz4 ``` **Download the snapshot** + +Full Node snapshot: ```bash -wget https://download.xinfin.network/xdcchain.tar +wget -c https://rpc.xdc.network/snapshots/mainnet/full/mainnet_full_latest.tar.lz4 ``` -**Unpack the xdcchain.tar file** + +Archive Node snapshot: ```bash -tar -xvzf xdcchain.tar +wget -c https://rpc.xdc.network/snapshots/mainnet/archive/mainnet_archive_latest.tar.lz4 ``` -**The unpacking will take some time, and it will look like this:** +If the download is interrupted, run the same `wget -c` command again to resume it. -![unpacking](../../img/unpacking.png) +**Unpack the snapshot file** (requires `lz4`; for an Archive Node, use `mainnet_archive_latest.tar.lz4`) +```bash +sudo apt install -y lz4 +lz4 -d -c mainnet_full_latest.tar.lz4 | tar -xvf - +``` +**The unpacking will take some time. It creates an `XDC` directory and lists files like this:** +``` +XDC/ +XDC/chaindata/ +XDC/chaindata/2359986.ldb +... +``` **The following command will move the xdcchain/XDC to xdcchain/XDC_backup** ```bash @@ -559,31 +596,34 @@ This command will bring your node up and it will start syncing to the network. O sudo docker-compose -f docker-compose.yml down ``` -**Remove the old xdchain file from the server** +**Remove any old snapshot file from the server** ```bash -rm -rf apothem.tar +rm -f testnet_full_latest.tar.lz4 testnet_archive_latest.tar.lz4 ``` **Download the snapshot** Full Node snapshot: ```bash -wget http://downloads.apothem.network/xdcchain.tar +wget -c https://rpc.xdc.network/snapshots/testnet/full/testnet_full_latest.tar.lz4 ``` Archive Node snapshot: ```bash -wget http://downloads.apothem.network/xdcchain_archive.tar +wget -c https://rpc.xdc.network/snapshots/testnet/archive/testnet_archive_latest.tar.lz4 ``` -**Unpack the apothem.tar file** +**Unpack the snapshot file** (requires `lz4`; for an Archive Node, use `testnet_archive_latest.tar.lz4`) ```bash -tar -xvzf apothem.tar +sudo apt install -y lz4 +lz4 -d -c testnet_full_latest.tar.lz4 | tar -xvf - ``` -**Move the xdcchain-testnet** +**Back up the old chain data and move the new `XDC` directory into xdcchain-testnet** ```bash +mv xdcchain-testnet/XDC xdcchain-testnet/XDC_backup mv XDC xdcchain-testnet +rm -rf xdcchain-testnet/XDC/nodekey ``` **Bring up the node**