chia-blockchain/install-timelord.sh
2020-04-05 18:35:48 -07:00

36 lines
1.3 KiB
Bash

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)'`
if [ `uname` = "Linux" ] && type apt-get;
then UBUNTU_DEBIAN=1
echo "Found Ubuntu/Debian"
else
UBUNTU_DEBIAN=0
fi
echo "This script assumes it is run from the chia venv - '. ./activate' before running."
if [ -e $THE_PATH ]
then
echo $THE_PATH
echo "vdf_client already exists, no action taken"
else
if [ -e venv/bin/python && $UBUNTU_DEBIAN ];
then
echo "installing chiavdf from source on Ubuntu/Debian"
# Check for development tools
sudo apt-get install cmake libgmp-dev libboost-python-dev libbost-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
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
venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
else
echo "no venv created yet, please run install.sh"
fi
fi