Skip to content
Merged
Show file tree
Hide file tree
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
61 changes: 47 additions & 14 deletions docs/xdcchain/developers/node_operators/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,57 @@ The following steps are to expedite the syncing process of your node with the XD

<iframe width="768" height="432" src="https://www.youtube.com/embed/ZQF3f0Zd6-k" title="Downloading an XDC Network Snapshot to Expedite Node Syncing to" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

**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
Expand Down Expand Up @@ -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**
Expand Down
84 changes: 62 additions & 22 deletions docs/xdcchain/developers/node_operators/masternode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -510,27 +517,57 @@ The following steps are to expedite the syncing process of your node with the XD

<iframe width="768" height="432" src="https://www.youtube.com/embed/ZQF3f0Zd6-k" title="Downloading an XDC Network Snapshot to Expedite Node Syncing to" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

**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
Expand Down Expand Up @@ -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**
Expand Down
Loading