Skip to content

Instantly share code, notes, and snippets.

@jetbalsa
Last active February 20, 2021 22:22
Show Gist options
  • Save jetbalsa/8510de09d2ee05a8e66d815968420343 to your computer and use it in GitHub Desktop.
Save jetbalsa/8510de09d2ee05a8e66d815968420343 to your computer and use it in GitHub Desktop.
#!/bin/bash
##CHECK IF INSTALLED AND DOWNLOAD
if [ ! -f ~/dogecoin-bin/bin/dogecoind ]; then
command -v curl >/dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Aborting."; exit 1; }
##CHECK ARCH
arch=$(uname -m)
echo Downloading Dogecoind for $arch
if [ "$arch" == 'x86_64' ]
then
wget https://github.com/dogecoin/dogecoin/releases/download/v1.10.0/dogecoin-1.10.0-linux64.tar.gz -O dogecoin.tar.gz
else
wget https://github.com/dogecoin/dogecoin/releases/download/v1.10.0/dogecoin-1.10.0-linux32.tar.gz -O dogecoin.tar.gz
fi
echo Extracting Dogecoind
tar -zxvvf dogecoin.tar.gz
rm dogecoin.tar.gz
mv dogecoin-1.10.0 dogecoin-bin
fi
if [ ! -f ~/dogecoin-bin/bin/dogecoind ]; then
echo ERROR -- Unable to Locate the Dogecoin Daemon!
echo Exiting
exit
fi
if [ ! -f ~/.dogecoin/dogecoin.conf ]; then
mkdir ~/.dogecoin
echo rpcuser=dogecoinrpc > ~/.dogecoin/dogecoin.conf
PWord=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1`
echo rpcpassword=$PWord >> ~/.dogecoin/dogecoin.conf
echo Downloading blockchain.tar from Google Drive provided by /u/xJRWR
cd ~/.dogecoin
fileid="0B4kwVxcNWulsZk1WTmo0NnFoUWM"
destination="bootstrap.tar"
curl -c /tmp/cookie -L -o /tmp/probe.bin "https://drive.google.com/uc?export=download&id=${fileid}"
confirm=$(tr ';' '\n' < /tmp/probe.bin | grep confirm)
confirm=${confirm:8:4}
curl -C - -b /tmp/cookie -L -o "$destination" "https://drive.google.com/uc?export=download&id=${fileid}&confirm=${confirm}"
tar -xvvf ~/.dogecoin/bootstrap.tar
rm ~/.dogecoin/bootstrap.tar
fi
echo Running Dogecoind in the background
~/dogecoin-bin/bin/dogecoind -maxconnections=500 -daemon
echo Run \" tail -f ~/.dogecoin/debug.log \" to watch the download status.
@thisisbrians
Copy link

Any chance you want to update this to work with the latest bootstrap from /r/dogecoin? I may look into this myself later today...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment