chia-blockchain/install-timelord.sh

49 lines
2.2 KiB
Bash
Raw Normal View History

2020-04-06 11:19:25 +03:00
echo "This requires the chia python virtual environment."
echo "Execute '. ./activate' if you have not already, before running."
export BUILD_VDF_BENCH=Y # Installs the useful vdf_bench test of CPU squaring speed
THE_PATH=`python -c 'import pkg_resources; print( pkg_resources.get_distribution("chiavdf").location)' 2> /dev/null`/vdf_client
CHIAVDF_VERSION=`python -c 'from setup import dependencies; t = [_ for _ in dependencies if _.startswith("chiavdf")][0]; print(t)'`
2020-04-06 03:52:34 +03:00
2020-04-06 03:43:03 +03:00
if [ `uname` = "Linux" ] && type apt-get;
2020-04-06 04:48:36 +03:00
then UBUNTU_DEBIAN=true
2020-04-06 04:57:35 +03:00
echo "Found Ubuntu/Debian"
2020-04-08 22:42:12 +03:00
elif [ `uname` = "Darwin" ];
then MACOS=true
echo "Found MacOS"
2020-04-06 03:43:03 +03:00
fi
2020-04-08 23:25:51 +03:00
if [ -e $THE_PATH ] && ! test $MACOS
then
2020-03-29 21:43:38 +03:00
echo $THE_PATH
echo "vdf_client already exists, no action taken"
else
2020-04-06 04:56:06 +03:00
if [ -e venv/bin/python ] && test $UBUNTU_DEBIAN
then
echo "Installing chiavdf from source on Ubuntu/Debian"
2020-04-06 04:57:35 +03:00
# Install needed development tools
2020-04-06 05:05:25 +03:00
sudo apt-get install cmake libgmp-dev libboost-python-dev libpython3.7-dev libboost-system-dev -y
echo venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
ln -s venv/lib/python3.7/site-packages/vdf_bench
elif [ -e venv/bin/python ] && test $MACOS && brew info boost | grep -q 'Not installed'
2020-04-08 22:42:12 +03:00
then
echo "Installing chiavdf requirements for MacOS"
brew install boost
echo "installing chiavdf from source for MacOS"
# User needs to provide required packages
echo venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
ln -s venv/lib/python3.7/site-packages/vdf_bench
2020-04-06 04:24:50 +03:00
elif [ -e venv/bin/python ]
then
echo "installing chiavdf from source"
# User needs to provide required packages
echo venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
2020-04-06 04:57:35 +03:00
venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
ln -s venv/lib/python3.7/site-packages/vdf_bench
else
echo "no venv created yet, please run install.sh"
fi
fi
echo "To see how fast your timelord is likely to be try './vdf_bench squareasm 250000' for an ips estimate"