Skip to content

Commit 016fbdd

Browse files
authored
Merge pull request #858 from Chia-Network/update-snapshot-db-instructions
Update snapshot db instructions
2 parents a41f4b4 + 75e207a commit 016fbdd

File tree

9 files changed

+105
-88
lines changed

9 files changed

+105
-88
lines changed

docs/chia-blockchain/resources/faq.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -546,12 +546,8 @@ To show hidden files on Mac finder click "COMMAND"+"SHIFT"+"." (period), on linu
546546

547547
### How do I use the Official Chia Blockchain snapshot torrent?
548548

549-
1. Download the torrent file from https://www.chia.net/downloads/#database-checkpoint
550-
2. Use a torrent client to download the full db (I have used bittorrent and qbittorrent)
551-
3. Unpack/reassemble the torrent file that was downloaded (on windows I used 7zip, Mac and linux have built in tools that work for this)
552-
4. Move the db to the correct folder (~\.chia\mainnet\db\) and update the name to "blockchain_v2_mainnet.sqlite" (removing the date information in the name)
553-
5. Verify the config file (~\.chia\mainnet\config\config.yaml) has the correct value under the full_node section for `database_path: db/blockchain_v2_CHALLENGE.sqlite` (should only need to change the v1 to v2)
554-
6. Launch chia and wait for a bit (the height to hash and peers files need to be built so this can take upwards of 30 minutes)
549+
The process for using the official database snapshot torrent can be found here:
550+
https://docs.chia.net/reference-client/troubleshooting/node-syncing/#using-the-official-database-snapshot-torrent
555551

556552
### How do I move the Chia blockchain database to another drive?
557553

docs/guides/crash-course/introduction.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,6 @@ If you are already on a testnet, skip to [instructions for the CLI](#cli).
210210

211211
For most dev work on Chia, you'll want to be on the testnet. That way, you're learning with fake Chia and don't put any funds at risk.
212212

213-
:::info
214-
215-
If you were previously running on mainnet, you will have a list of mainnet peers stored in the following file:
216-
217-
```
218-
~/.chia/mainnet/db/peers.dat
219-
```
220-
221-
Be sure to **rename or delete** this file when you convert your system to running on testnet. If you do not do this, your system will eventually drop its mainnet peers and add new testnet peers, but this could take a long time.
222-
223-
One way to speed up the peer discovery process even more is to run the [add-nodes bash script](https://github.com/wallentx/farm-and-ranch-supply-depot/blob/main/bin/extra/add-nodes). Note that this script won't work on Windows. Your mileage also may vary on Linux and MacOS.
224-
225-
:::
226-
227213
Run the following commands to instruct your node to connect to the testnet:
228214

229215
```bash

docs/guides/nft/nft-bulk-mint.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,6 @@ The bulk minting tool comes with a packaged version of Chia. In order to use the
138138
chia configure --testnet true
139139
```
140140

141-
:::note
142-
If you previously had been running Chia on mainnet, then your peers table will be populated with mainnet peers.
143-
When you switch to running on the testnet, the peers listed in this table will time out.
144-
Eventually the table will be repopulated with testnet peers, but this can take a long time.
145-
In order to expedite this process, We recommend that you delete your peers tables:
146-
147-
- `~/.chia/mainnet/db/peers.dat`
148-
- `~/.chia/mainnet/wallet/db/wallet_peers.dat`
149-
:::
150-
151141
2. We recommend that you use `INFO` level logging instead of the default `WARNING` level. To do this, run:
152142

153143
```bash

docs/reference-client/install-and-setup/testnets.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,12 @@ chia configure --testnet true
3636

3737
### Download the official testnet database (optional)
3838

39-
This step is optional, but it will speed up syncing with the testnet.
40-
41-
- Linux users: `wget https://databases.chia.net/file/chia-public-databases/blockchain_v2_testnet11.sqlite.gz` while in the directory (a v1 db is not available for testnet11).
42-
- Windows users: download it from [https://downloads.chia.net/testnet11/](https://downloads.chia.net/testnet11/) and move it to the db folder in the mainnet/ directory in the Chia root folder (i.e. `~/.chia/mainnet/db` is the database directory).
43-
44-
:::note
45-
46-
Make sure to unzip the database before continuing to the next step.
47-
48-
:::
49-
50-
:::tip
51-
52-
Prior to starting your node, it is recommended to delete `peers.dat`, located in `~/.chia/mainnet/db`. If you don't delete this file you might see `WARNING Invalid handshake with peer` in your log file. The reason for this is that peers.dat will contain mainnet peers, which are not running on the testnet. If you do see these warnings, there's no requirement to take further action -- they'll eventually stop appearing as your invalid peers are replaced with valid ones.
53-
54-
:::
39+
The process for using the official database snapshot torrent can be found here:
40+
https://docs.chia.net/reference-client/troubleshooting/node-syncing/#using-the-official-database-snapshot-torrent
5541

5642
### Start your node and connect to peers
5743

5844
```bash
59-
# Note - make sure to delete the peers.dat file in ~/.chia/mainnet/db prior to starting your node
6045
# Start your node
6146
chia start farmer
6247

docs/reference-client/troubleshooting/node-syncing.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,103 @@ slug: /reference-client/troubleshooting/node-syncing
66
import Tabs from '@theme/Tabs';
77
import TabItem from '@theme/TabItem';
88

9+
## Using the Official Database Snapshot Torrent
10+
11+
:::note
12+
This process assumes you already have chia installed and all files are present in their default locations, to confirm make sure the `~/.chia/mainnet/db/` directory exists.
13+
14+
If you are upgrading from a version prior to Chia 2.1.0, verify your config file (`~/.chia/mainnet/config/config.yaml`) has the correct value under the `full_node` section for `database_path` (v1 vs the current v2):
15+
`db/blockchain_v2_CHALLENGE.sqlite`
16+
17+
When starting chia for the first time with the database snapshot it can take upwards of 30 minutes for it to verify the db and load.
18+
:::
19+
20+
Using the GUI:
21+
22+
1. Download the torrent file from https://www.chia.net/downloads/#database-checkpoint (mainnet and testnet database torrents are available)
23+
2. Use a torrent client to download the full db (bittorrent, qbittorrent, and transmission have be used successfully for this)
24+
3. Unpack/reassemble the torrent file that was downloaded (on windows one can use 7zip, Mac and linux have built in tools that work for this)
25+
4. Move the db and associated files to the correct folder (`~/.chia/mainnet/db/` is the default location for these files)
26+
27+
Using the CLI (Linux and MacOS only):
28+
29+
<Tabs
30+
defaultValue="linux"
31+
groupId="source"
32+
values={[
33+
{label: 'Linux', value: 'linux'},
34+
{label: 'MacOS', value: 'macos'},
35+
]}>
36+
<TabItem value="linux">
37+
38+
1. Set your network (change to `testnet11` for the testnet db):
39+
40+
```bash
41+
NETWORK="mainnet"
42+
```
43+
44+
2. Install a torrent client (aria is used in the below examples, other torrent clients can be used).
45+
46+
```bash
47+
sudo apt install aria2
48+
```
49+
50+
3. Download the torrent using the network identifier set earlier. Note this can take a couple of hours depending on network speeds.
51+
52+
```bash
53+
aria2c --seed-time=0 "https://torrents.chia.net/databases/$NETWORK/$NETWORK.latest.tar.gz.torrent" --dir="$HOME/Downloads"
54+
```
55+
56+
4. Unpack the DB using the network identifier and wildcard for the date in the file name
57+
58+
```bash
59+
ARCHIVE=$(find "$HOME/Downloads" -name "$NETWORK.*.tar.gz" -type f | sort -r | head -n1) && echo "Extracting $ARCHIVE - this may take upwards of 35 minutes with no visible progress..." && { tar -xf "$ARCHIVE" -C "$HOME/Downloads" || { echo "Error: Extraction failed, please verify the file downloaded properly and try again"; } }
60+
```
61+
62+
5. Move the db and associated files to the correct folder. Make sure to update the final directory path if needed and note that any existing files with the same names will be overwritten.
63+
64+
```bash
65+
echo "Moving files to Chia directory - this may take upwards of 5 minutes with no visible progress..." && mv -f "$HOME/Downloads/blockchain_v2_$NETWORK.sqlite" ~/.chia/mainnet/db/ && mv -f "$HOME/Downloads/height-to-hash" ~/.chia/mainnet/db/ && mv -f "$HOME/Downloads/sub-epoch-summaries" ~/.chia/mainnet/db/
66+
```
67+
68+
</TabItem>
69+
<TabItem value="macos">
70+
71+
1. Set your network (change to `testnet11` for the testnet db):
72+
73+
```bash
74+
NETWORK="mainnet"
75+
```
76+
77+
2. Install a torrent client (aria is used in the below examples, other torrent clients can be used).
78+
79+
```bash
80+
brew install aria2
81+
```
82+
83+
3. Download the torrent using the network identifier set earlier. Note this can take a couple of hours depending on network speeds.
84+
85+
```bash
86+
aria2c --seed-time=0 "https://torrents.chia.net/databases/$NETWORK/$NETWORK.latest.tar.gz.torrent" --dir="$HOME/Downloads"
87+
```
88+
89+
4. Unpack the DB using the network identifier and wildcard for the date in the file name
90+
91+
```bash
92+
ARCHIVE=$(find "$HOME/Downloads" -name "$NETWORK.*.tar.gz" -type f | sort -r | head -n1) && echo "Extracting $ARCHIVE - this may take upwards of 35 minutes with no visible progress..." && { tar -xf "$ARCHIVE" -C "$HOME/Downloads" || { echo "Error: Extraction failed, please verify the file downloaded properly and try again"; } }
93+
```
94+
95+
5. Move the db and associated files to the correct folder. Make sure to update the final directory path if needed and note that any existing files with the same names will be overwritten.
96+
97+
```bash
98+
echo "Moving files to Chia directory - this may take upwards of 5 minutes with no visible progress..." && mv -f "$HOME/Downloads/blockchain_v2_$NETWORK.sqlite" ~/.chia/mainnet/db/ && mv -f "$HOME/Downloads/height-to-hash" ~/.chia/mainnet/db/ && mv -f "$HOME/Downloads/sub-epoch-summaries" ~/.chia/mainnet/db/
99+
```
100+
101+
</TabItem>
102+
</Tabs>
103+
104+
## Port Forwarding Settings
105+
9106
Forwarding port 8444 can solve some sync issues and it also helps improve Chia's overall network health.
10107
11108
Port 8444 is the [port](https://en.wikipedia.org/wiki/Port_%28computer_networking%29) through which other Chia nodes can communicate with your node. When you set up port forwarding on port 8444, the Chia software on your computer allows other nodes to easily communicate and sync the Chia blockchain with your node.

i18n/zh-Hans/docusaurus-plugin-content-docs/current/chia-blockchain/resources/faq.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -546,12 +546,8 @@ To show hidden files on Mac finder click "COMMAND"+"SHIFT"+"." (period), on linu
546546

547547
### How do I use the Official Chia Blockchain snapshot torrent?
548548

549-
1. Download the torrent file from https://www.chia.net/downloads/#database-checkpoint
550-
2. Use a torrent client to download the full db. <a href="https://www.bittorrent.com/">Bittorrent</a> is recommended but any torrent client will work.
551-
3. Unpack/reassemble the torrent file that was downloaded (on windows I used 7zip, Mac and linux have built in tools that work for this)
552-
4. Move the db to the correct folder (~\.chia\mainnet\db\) and update the name to "blockchain_v2_mainnet.sqlite" (removing the date information in the name)
553-
5. Verify the config file (~\.chia\mainnet\config\config.yaml) has the correct value under the full_node section for `database_path: db/blockchain_v2_CHALLENGE.sqlite` (should only need to change the v1 to v2)
554-
6. Launch chia and wait for a bit (the height to hash and peers files need to be built so this can take upwards of 30 minutes)
549+
The process for using the official database snapshot torrent can be found here:
550+
https://docs.chia.net/reference-client/troubleshooting/node-syncing/#using-the-official-database-snapshot-torrent
555551

556552
### How do I move the Chia blockchain database to another drive?
557553

i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/crash-course/introduction.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,6 @@ If you are already on a testnet, skip to [instructions for the CLI](#cli).
210210

211211
For most dev work on Chia, you'll want to be on the testnet. That way, you're learning with fake Chia and don't put any funds at risk.
212212

213-
:::info
214-
215-
If you were previously running on mainnet, you will have a list of mainnet peers stored in the following file:
216-
217-
```
218-
~/.chia/mainnet/db/peers.dat
219-
```
220-
221-
Be sure to **rename or delete** this file when you convert your system to running on testnet. If you do not do this, your system will eventually drop its mainnet peers and add new testnet peers, but this could take a long time.
222-
223-
One way to speed up the peer discovery process even more is to run the [add-nodes bash script](https://github.com/wallentx/farm-and-ranch-supply-depot/blob/main/bin/extra/add-nodes). Note that this script won't work on Windows. Your mileage also may vary on Linux and MacOS.
224-
225-
:::
226-
227213
Run the following commands to instruct your node to connect to the testnet:
228214

229215
```bash

i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/nft/nft-bulk-mint.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,6 @@ The bulk minting tool comes with a packaged version of Chia. In order to use the
140140
chia configure --testnet true
141141
```
142142

143-
:::note
144-
If you previously had been running Chia on mainnet, then your peers table will be populated with mainnet peers. When you switch to running on the testnet, the peers listed in this table will time out. Eventually the table will be repopulated with testnet peers, but this can take a long time. In order to expedite this process, We recommend that you delete your peers tables:
145-
146-
- `~/.chia/mainnet/db/peers.dat`
147-
- `~/.chia/mainnet/wallet/db/wallet_peers.dat`
148-
:::
149-
150143
2. We recommend that you use `INFO` level logging instead of the default `WARNING` level. To do this, run:
151144

152145
```bash

i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference-client/install-and-setup/testnets.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,8 @@ chia configure --testnet true
4040

4141
This step is optional, but it will speed up syncing with the testnet
4242

43-
- Linux users: `wget https://databases.chia.net/file/chia-public-databases/blockchain_v2_testnet10.sqlite.gz` while in the directory (a v1 DB is also available, but no longer updated).
44-
- Windows users: download it from [https://downloads.chia.net/testnet10/](https://downloads.chia.net/testnet10/) and move it to the db folder in the mainnet/ directory in the Chia root folder (i.e. \~/.chia/mainnet/db is the database directory).
45-
46-
:::note
47-
48-
_Make sure to unzip the database before continuing to the next step._
49-
50-
:::
51-
52-
:::tip
53-
54-
Prior to starting your node, it is recommended to delete `peers.dat`, located in `~/.chia/mainnet/db`. If you don't delete this file you might see `WARNING Invalid handshake with peer` in your log file. The reason for this is that peers.dat will contain mainnet peers, which are not running on the testnet. If you do see these warnings, there's no requirement to take further action -- they'll eventually stop appearing as your invalid peers are replaced with valid ones.
55-
56-
:::
43+
The process for using the official database snapshot torrent can be found here:
44+
https://docs.chia.net/reference-client/troubleshooting/node-syncing/#using-the-official-database-snapshot-torrent
5745

5846
### Start your node and connect to peers
5947

0 commit comments

Comments
 (0)