Skip to content

Commit

Permalink
Merge pull request #1191 from ApolloFoundation/APL-2121-create-update…
Browse files Browse the repository at this point in the history
…-packages-q4-2021

Added database removing and downloading
  • Loading branch information
AndrewBoyarsky committed Nov 18, 2021
2 parents 696dca0 + 16eec4d commit caa2114
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 58 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.48.10
1.48.11
2 changes: 1 addition & 1 deletion apl-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>

<artifactId>apl-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion apl-api2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>

<artifactId>apl-api2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion apl-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.apollocurrency</groupId>
<artifactId>apl-bom</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
<packaging>pom</packaging>
<name>apl-bom</name>

Expand Down
2 changes: 1 addition & 1 deletion apl-conf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>
<artifactId>apl-conf</artifactId>
<name>apl-conf</name>
Expand Down
2 changes: 1 addition & 1 deletion apl-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>
<artifactId>apl-core</artifactId>
<name>apl-core</name>
Expand Down
2 changes: 1 addition & 1 deletion apl-crypto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>

<artifactId>apl-crypto</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion apl-db-updater/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>apollo-blockchain</artifactId>
<groupId>com.apollocurrency</groupId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apl-dex/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>apollo-blockchain</artifactId>
<groupId>com.apollocurrency</groupId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apl-exec/packaging/pkg-apollo-blockchain.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "apollo-blockchain",
"description": "Apollo blockchain backend",
"version": "1.48.10",
"version": "1.48.11",
"dependencies": [
{
"name": "OpenJDK",
Expand Down
2 changes: 1 addition & 1 deletion apl-exec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>
<artifactId>apl-exec</artifactId>
<name>apl-exec</name>
Expand Down
2 changes: 1 addition & 1 deletion apl-updater/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>

<artifactId>apl-updater</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion apl-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>

<artifactId>apl-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public final class Constants {

public static final Version VERSION = new Version("1.48.10");
public static final Version VERSION = new Version("1.48.11");

public static final String APPLICATION = "Apollo";
public static final String APPLICATION_DIR_NAME = "apl-blockchain";
Expand Down
2 changes: 1 addition & 1 deletion apl-vault-wallet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
</parent>

<artifactId>apl-vault-wallet</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>1.48.10</version>
<version>1.48.11</version>
<packaging>pom</packaging>
<name>apollo-blockchain</name>

Expand Down
23 changes: 8 additions & 15 deletions updater/install_libs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,15 @@ del /S /F /Q %1\bin
del /S /F /Q %1\sbin
del /F /Q %1\*.jar

rem curl --retry 100 -o %1\libs.zip -k https://s3.amazonaws.com/updates.apollowallet.org/libs/ApolloWallet-%VERSION%-libs.zip
rem unzip -o %1\libs.zip -d %1

del /F /Q %1\lib\apl-*
rem rmdir /S /Q %1\lib
rem mkdir %1\lib

rem move /Y %WALLETDIR:~0,-1%\ApolloWallet-%VERSION%-libs\*" %WALLETDIR:~0,-1%\lib"
rem del /S /F /Q %1\ApolloWallet-%VERSION%-libs*
rem mkdir %1\tmpdir

rem curl --retry 100 -o %1\tmpdir\%2.zip -k https://s3.amazonaws.com/updates.apollowallet.org/database/%2-2020-q1.zip
rem del /S /F /Q %userprofile%\.apl-blockchain\apl-blockchain-db\%2
rem unzip -o %1\tmpdir\%2.zip -d %userprofile%\.apl-blockchain\apl-blockchain-db\
rem del /S /F /Q %1\tmpdir\%2.zip


mkdir %1\tmpdir

curl --retry 100 -o %1\tmpdir\%2.tar.gz -k https://apl-db-upd.s3.fr-par.scw.cloud/%2-2021-q4.tar.gz
del /S /F /Q %userprofile%\.apl-blockchain\apl-blockchain-db\%2
7z x %1\tmpdir\%2.tar.gz -so | 7z x -ttar -si -y -o"%userprofile%\.apl-blockchain\apl-blockchain-db\"
del /S /F /Q %1\tmpdir\%2.tar.gz
rmdir %1\tmpdir



Expand Down
32 changes: 16 additions & 16 deletions updater/update1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ then
cd $1/..
rm -rfv apollo-web-ui
rm -rfv apollo-tools
rm -rfv apollo-desktop


chmod 755 $1/../apollo-blockchain/bin/*.sh

Expand Down Expand Up @@ -240,25 +242,23 @@ then
NETID=b5d7b6

esac

notify "Downloading database"
# TODO: ! refactor and ncomment that block
# if [ "$#" -eq 3 ]
# then
# if [ ${NOSHARD} == false ]
# then
# bash ./update3.sh $1 $2 $3 true ${NETID}
# fi
# else
# bash ./update3.sh $1 $2 $3 $4 $5
# fi


if [ "$#" -eq 3 ]
then
if [ ${NOSHARD} == false ]
then
bash ./update3.sh $1 $2 $3 true ${NETID}
fi
else

bash ./update3.sh $1 $2 $3 $4 $5
fi

# notify "Downloading db shards..."

if [[ -d conf ]]; then
mv -fv conf apollo-blockchain
fi
# if [[ -d conf ]]; then
# mv -fv conf apollo-blockchain
# fi
APLCMDLINE=$(echo ${APLCMDLINE} | sed s/shards/shard/g)
if [ $3 == true ]
then
Expand Down
23 changes: 12 additions & 11 deletions updater/update3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@

echo Downloading shards...

DOWNLOAD_PATH=https://s3.amazonaws.com/updates.apollowallet.org/database/
DOWNLOAD_PATH=https://apl-db-upd.s3.fr-par.scw.cloud/

DB_POSTFIX=-2020-q1
DB_POSTFIX=-2021-q4
if [ $4 == 'false' ]
then
DB_POSTFIX=${DB_POSTFIX}-noshards
fi

cd $1
rm -rfv $1/tmpdir
mkdir tmpdir
cd tmpdir
rm -rfv "$5".tar.gz
#echo https://s3.amazonaws.com/updates.apollowallet.org/database/$5.tar.gz

wget -v ${DOWNLOAD_PATH}$5${DB_POSTFIX}.tar.gz -O $5.tar.gz || curl --retry 100 ${DOWNLOAD_PATH}$5${DB_POSTFIX}.tar.gz -o $5.tar.gz
echo Unpacking...
tar -zxvf $5.tar.gz
Expand All @@ -38,7 +39,7 @@ echo Config dir = ${CONFIGDIR}
if [ $3 == 'true' ]
then
rm -rfv ~/.apl-blockchain/apl-blockchain-db/$5
cp -rfv $1/tmpdir/$5 ~/.apl-blockchain/apl-blockchain-db/
cp -rfv $1/tmpdir/* ~/.apl-blockchain/apl-blockchain-db/

else
if [ -f $1/$CONFIGDIR/apl-blockchain.properties ]
Expand All @@ -48,20 +49,20 @@ else
cd $1
cd $(cat $1/$CONFIGDIR/apl-blockchain.properties | grep customDbDir | cut -f2 -d'=')
rm -rfv $5
cp -rfv $1/tmpdir/$5 .
cp -rfv $1/tmpdir/* .
else
cd $1/apl-blockchain-db/
cd $1/../apl-blockchain-db/
rm -rfv $5
cp -rfv $1/tmpdir/$5 .
cp -rfv $1/tmpdir/* .
fi

else
cd $1/apl-blockchain-db/
cd $1/../apl-blockchain-db/
rm -rfv $5
cp -rfv $1/tmpdir/$5 .
cp -rfv $1/tmpdir/* .
fi

rm -rfv $/tmpdir
rm -rfv $1/tmpdir
fi

rm -rfv $/tmpdir
rm -rfv $1/tmpdir

0 comments on commit caa2114

Please sign in to comment.