2019-12-25 22:18:07 +03:00
|
|
|
set -e
|
|
|
|
|
2020-04-02 03:09:29 +03:00
|
|
|
find_python() {
|
|
|
|
set +e
|
|
|
|
unset BEST_VERSION
|
|
|
|
for V in 37 3.7 38 3.8 3
|
|
|
|
do
|
2020-04-02 19:01:22 +03:00
|
|
|
which python$V > /dev/null
|
|
|
|
if [ $? = 0 ]
|
2020-04-02 03:09:29 +03:00
|
|
|
then
|
2020-04-02 19:01:22 +03:00
|
|
|
if [ x$BEST_VERSION = x ]
|
2020-04-02 03:09:29 +03:00
|
|
|
then
|
|
|
|
BEST_VERSION=$V
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo $BEST_VERSION
|
|
|
|
set -e
|
|
|
|
}
|
|
|
|
|
2020-04-02 19:01:22 +03:00
|
|
|
if [ x$INSTALL_PYTHON_VERSION = x ]
|
|
|
|
then
|
2020-04-02 03:09:29 +03:00
|
|
|
INSTALL_PYTHON_VERSION=`find_python`
|
|
|
|
fi
|
|
|
|
|
2020-04-06 11:19:25 +03:00
|
|
|
# Manage npm and other install requirements on an OS specific basis
|
2020-04-06 00:01:45 +03:00
|
|
|
if [ `uname` = "Linux" ]; then
|
2020-04-06 02:23:19 +03:00
|
|
|
#LINUX=1
|
2020-04-06 00:01:45 +03:00
|
|
|
if type apt-get; then
|
2020-02-07 08:14:54 +03:00
|
|
|
# Debian/Ubuntu
|
2020-04-05 23:23:40 +03:00
|
|
|
sudo apt-get install -y npm
|
2020-04-06 00:01:45 +03:00
|
|
|
elif type yum; then
|
|
|
|
# CentOS or AMZN 2
|
|
|
|
sudo yum install -y python3 git
|
|
|
|
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
|
|
|
|
sudo yum install -y nodejs
|
|
|
|
fi
|
2020-04-06 20:26:00 +03:00
|
|
|
elif [ `uname` = "Darwin" ] && type brew; then
|
2020-04-07 01:44:24 +03:00
|
|
|
# gmp is only required until blspy gmp issue is fixed
|
|
|
|
# Hacky way to install these if not installed
|
|
|
|
brew list gmp || brew install gmp
|
|
|
|
brew list npm || brew install npm
|
|
|
|
#elif ! brew info npm >/dev/null 2>&1; then
|
|
|
|
#brew install npm
|
|
|
|
#fi
|
2020-04-06 20:26:00 +03:00
|
|
|
elif [ `uname` = "Darwin" ] && ! type brew; then
|
|
|
|
echo "Installation requires brew on MacOS"
|
2020-02-07 08:14:54 +03:00
|
|
|
fi
|
|
|
|
|
2020-03-28 01:59:25 +03:00
|
|
|
# this fancy syntax sets INSTALL_PYTHON_PATH to "python3.7" unless INSTALL_PYTHON_VERSION is defined
|
|
|
|
# if INSTALL_PYTHON_VERSION=3.8, then INSTALL_PYTHON_PATH becomes python3.8
|
|
|
|
|
|
|
|
INSTALL_PYTHON_PATH=python${INSTALL_PYTHON_VERSION:-3.7}
|
|
|
|
|
|
|
|
$INSTALL_PYTHON_PATH -m venv venv
|
2020-03-28 03:52:24 +03:00
|
|
|
if [ ! -f "activate" ]; then
|
|
|
|
ln -s venv/bin/activate
|
|
|
|
fi
|
2020-04-06 08:17:45 +03:00
|
|
|
echo "Python version is $INSTALL_PYTHON_VERSION"
|
2020-03-28 01:08:50 +03:00
|
|
|
. ./activate
|
2020-03-27 05:50:34 +03:00
|
|
|
# pip 20.x+ supports Linux binary wheels
|
2020-03-25 07:52:23 +03:00
|
|
|
pip install --upgrade pip
|
2020-04-06 10:19:39 +03:00
|
|
|
#if [ "$INSTALL_PYTHON_VERSION" = "3.8" ]; then
|
|
|
|
# This remains in case there is a diversion of binary wheels
|
|
|
|
pip install -i https://hosted.chia.net/simple/ miniupnpc==2.0.2 setproctitle==1.1.10 cbor2==5.0.1
|
2020-03-28 05:06:16 +03:00
|
|
|
pip install -e .
|
2019-11-20 23:56:48 +03:00
|
|
|
|
2020-03-30 02:37:26 +03:00
|
|
|
cd ./electron-ui
|
2020-03-24 16:43:41 +03:00
|
|
|
npm install
|
2020-02-07 08:14:54 +03:00
|
|
|
|
2019-12-25 22:18:07 +03:00
|
|
|
echo ""
|
|
|
|
echo "Chia blockchain install.sh complete."
|
2019-11-28 10:50:42 +03:00
|
|
|
echo "For assistance join us on Keybase in the #testnet chat channel"
|
|
|
|
echo "https://keybase.io/team/chia_network.public"
|
2020-03-27 20:37:22 +03:00
|
|
|
echo ""
|
|
|
|
echo "Return to the README.md to start running the Chia blockchain"
|
|
|
|
echo "https://github.com/Chia-Network/chia-blockchain/blob/master/README.md"
|
2020-03-28 05:33:58 +03:00
|
|
|
echo "Type '. ./activate' to use Chia"
|