Skip to content

Commit

Permalink
Merge pull request #972 from guydavis/develop
Browse files Browse the repository at this point in the history
Account for another year of Chia blockchain DB bloat.
  • Loading branch information
guydavis authored Feb 29, 2024
2 parents b8f1d8f + 3be12ce commit 76b1699
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions common/config/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def is_setup():
return foundKey

# On very first launch of the main Chia container, blockchain DB gz is being downloaded via torrent so must wait.
CHIA_COMPRESSED_DB_SIZE = 56 * 1024 * 1024 * 1024 # Compressed GB in March 2023
CHIA_BLOCKCHAIN_DB_SIZE = 106 * 1024 * 1024 * 1024 # Uncompressed GB in March 2023
CHIA_COMPRESSED_DB_SIZE = 75 * 1024 * 1024 * 1024 # Compressed GB in March 2024
CHIA_BLOCKCHAIN_DB_SIZE = 127 * 1024 * 1024 * 1024 # Uncompressed GB in March 2024
def blockchain_downloading():
db_path = '/root/.chia/mainnet/db'
if path.exists(f"{db_path}/blockchain_v1_mainnet.sqlite") or path.exists(f"{db_path}/blockchain_v2_mainnet.sqlite"):
Expand Down
4 changes: 2 additions & 2 deletions scripts/forks/chia_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ if [[ "${blockchain_db_download}" == 'true' ]] \
echo "Downloading Chia blockchain DB (many GBs in size) on first launch..."
echo "Please be patient as this takes hours now, but saves days of syncing time later."
mkdir -p /root/.chia/mainnet/db/chia && cd /root/.chia/mainnet/db/chia
# Latest Blockchain DB, first try direct download, then fallback to slower torrent
# Latest Blockchain DB via torrent download
torrent=$(curl -s https://www.chia.net/downloads/ | grep -Po "https://torrents.chia.net/databases/mainnet/mainnet.\d{4}-\d{2}-\d{2}.tar.gz.torrent")
echo "Please be patient! Downloading blockchain database indirectly (via libtorrent) from: "
echo " ${torrent}"
curl -skLJ -O ${torrent}
/usr/bin/python /machinaris/scripts/chiadb_download.py $PWD/*.torrent >> /tmp/chiadb_download.log 2>&1
echo "Now decompressing the blockchain database..."
cd /root/.chia/mainnet/db/chia && tar -xf *.gz
mv blockchain_v2_mainnet.sqlite height-to-hash ..
cd /root/.chia/mainnet/db
mv /root/.chia/mainnet/db/chia/blockchain_v2_mainnet.*.sqlite blockchain_v2_mainnet.sqlite
rm -rf /root/.chia/mainnet/db/chia
fi

Expand Down
4 changes: 2 additions & 2 deletions scripts/forks/gigahorse_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ if [[ "${blockchain_db_download}" == 'true' ]] \
echo "Downloading Chia blockchain DB (many GBs in size) on first launch..."
echo "Please be patient as this takes hours now, but saves days of syncing time later."
mkdir -p /root/.chia/mainnet/db/chia && cd /root/.chia/mainnet/db/chia
# Latest Blockchain DB, first try direct download, then fallback to slower torrent
# Latest Blockchain DB via torrent download
torrent=$(curl -s https://www.chia.net/downloads/ | grep -Po "https://torrents.chia.net/databases/mainnet/mainnet.\d{4}-\d{2}-\d{2}.tar.gz.torrent")
echo "Please be patient! Downloading blockchain database indirectly (via libtorrent) from: "
echo " ${torrent}"
curl -skLJ -O ${torrent}
/usr/bin/python /machinaris/scripts/chiadb_download.py $PWD/*.torrent >> /tmp/chiadb_download.log 2>&1
echo "Now decompressing the blockchain database..."
cd /root/.chia/mainnet/db/chia && tar -xf *.gz
mv blockchain_v2_mainnet.sqlite height-to-hash ..
cd /root/.chia/mainnet/db
mv /root/.chia/mainnet/db/chia/blockchain_v2_mainnet.*.sqlite blockchain_v2_mainnet.sqlite
rm -rf /root/.chia/mainnet/db/chia
fi

Expand Down
2 changes: 1 addition & 1 deletion web/templates/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{% autoescape false %}
<p>{{_(
'On very first launch, the Chia compressed blockchain database %(compressed)s is being downloaded from %(dl_link)s, then unzipped. At about %(uncompressed)s in uncompressed size, this will take a while. However an hour or two now, will save you multiple days of blockchain syncing later. Please be patient!',
compressed="(~56 GB)", uncompressed="106 GB",
compressed="(~75 GB)", uncompressed="127 GB",
dl_link='<a target="_blank" href="https://www.chia.net/downloads/">https://www.chia.net/downloads/</a>'
)}}</p>
<br />
Expand Down

0 comments on commit 76b1699

Please sign in to comment.