Skip to content

Commit

Permalink
+primary mirror has been set to GitHub repository as the fastest one.…
Browse files Browse the repository at this point in the history
… If the GitHub mirror is not available we have 2 more mirrors in the list
  • Loading branch information
ltraveler committed Oct 22, 2021
1 parent 6fbc8e2 commit c8efd46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion idena_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,17 @@ fi
#iDNA blockchain bootstrp mirrors
dnabc="https://sync.idena.site/idenachain.db.zip"
dnabc1="https://sync.idena-ar.com/idenachain.db.zip"
dnabc2="https://github.com/ltraveler/idena-runner.git"
function validate_url()
{
wget --spider $1
return $?
}
mkdir /home/$username/idena-go/datadir ; mkdir /home/$username/idena-go/datadir/idenachain.db
chown -R $username:$username /home/$username/idena-go/datadir
if validate_url $dnabc; then echo -e "${YELLOW}Downloading IDENA blockchain bootstrap: Mirror 01${NC}" && wget --directory-prefix=/home/$username/idena-go/datadir/idenachain.db $dnabc; elif validate_url $dnabc1; then echo -e "${YELLOW}Downloading IDENA blockchain bootstrap: Mirror 2${NC}" && wget --directory-prefix=/home/$username/idena-go/datadir/idenachain.db $dnabc1; else echo "IDENA blockchain mirror is not available"; fi;
if validate_url $dnabc2; then echo -e "${YELLOW}Downloading IDENA blockchain bootstrap: GitHub${NC}" && rm -rf /home/$username/idena-go/datadir/idenachain.db && git clone --depth=1 https://github.com/ltraveler/idenachain.db.git /home/$username/idena-go/datadir/idenachain.db && rm -rf /home/$username/idena-go/datadir/idenachain.db/.git; elif validate_url $dnabc; then echo -e "${YELLOW}Downloading IDENA blockchain bootstrap: Mirror 01${NC}" && wget --directory-prefix=/home/$username/idena-go/datadir/idenachain.db $dnabc; elif validate_url $dnabc1; then echo -e "${YELLOW}Downloading IDENA blockchain bootstrap: Mirror 2${NC}" && wget --directory-prefix=/home/$username/idena-go/datadir/idenachain.db $dnabc1; else echo "IDENA blockchain mirror is not available"; fi;
#Changing idenachain rights
chown -R $username:$username /home/$username/idena-go
#Continue as username
sudo -i -u $username bash << EOF
whoami
Expand Down

0 comments on commit c8efd46

Please sign in to comment.