Skip to content

Commit

Permalink
Clean up uname value selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
guydavis committed Oct 11, 2023
1 parent 06127fd commit e53026b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 48 deletions.
44 changes: 20 additions & 24 deletions scripts/bladebit_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,28 @@ BLADEBIT_BRANCH=$1 # Now ignored as install binaries from Github.
if [[ (${mode} =~ ^fullnode.* || ${mode} =~ "plotter") && (${blockchains} == 'chia') ]]; then
if [ ! -f /usr/bin/bladebit ] && [[ "${bladebit_skip_build}" != 'true' ]]; then
arch_name="$(uname -m)"
if [[ "${arch_name}" = "x86_64" ]] || [[ "${arch_name}" = "arm64" ]]; then
apt update && apt install -y build-essential cmake libgmp-dev libnuma-dev
cd /
apt update && apt install -y build-essential cmake libgmp-dev libnuma-dev
cd / && echo "Installing bladebit on ${arch_name}..."

# Now install CNI's separate binary for actual GPU plotting...
cd /opt/chia/bladebit
rm -f ./bladebit # Remove stale version bundled in the DEB package.
if [[ "${arch_name}" = "x86_64" ]]; then
curl -sLJO https://github.com/Chia-Network/bladebit/releases/download/v3.1.0/bladebit-v3.1.0-ubuntu-x86-64.tar.gz
curl -sLJO https://github.com/Chia-Network/bladebit/releases/download/v3.1.0/bladebit-cuda-v3.1.0-ubuntu-x86-64.tar.gz
else
curl -sLJO https://github.com/Chia-Network/bladebit/releases/download/v3.1.0/bladebit-v3.1.0-ubuntu-arm64.tar.gz
curl -sLJO https://github.com/Chia-Network/bladebit/releases/download/v3.1.0/bladebit-cuda-v3.1.0-ubuntu-arm64.tar.gz
fi
tar -xvf bladebit-v3.*.tar.gz
tar -xvf bladebit-cuda-v3.*.tar.gz
rm -f *tar.gz
chmod 755 bladebit*
chown root.root ./bladebit*

ln -s /opt/chia/bladebit/bladebit /usr/bin/bladebit
cd / && echo "Bladebit version: "`bladebit --version`
ln -s /opt/chia/bladebit/bladebit_cuda /usr/bin/bladebit_cuda
cd / && echo "Bladebit CUDA version: "`bladebit_cuda --version`
# Now install CNI's separate binary for actual GPU plotting...
cd /opt/chia/bladebit
rm -f ./bladebit # Remove stale version bundled in the DEB package.
if [[ "${arch_name}" = "x86_64" ]]; then
curl -sLJO https://github.com/Chia-Network/bladebit/releases/download/v3.1.0/bladebit-v3.1.0-ubuntu-x86-64.tar.gz
curl -sLJO https://github.com/Chia-Network/bladebit/releases/download/v3.1.0/bladebit-cuda-v3.1.0-ubuntu-x86-64.tar.gz
else
echo "Bladebit binary download skipped -> unsupported architecture: ${arch_name}"
curl -sLJO https://github.com/Chia-Network/bladebit/releases/download/v3.1.0/bladebit-v3.1.0-ubuntu-arm64.tar.gz
curl -sLJO https://github.com/Chia-Network/bladebit/releases/download/v3.1.0/bladebit-cuda-v3.1.0-ubuntu-arm64.tar.gz
fi
tar -xvf bladebit-v3.*.tar.gz
tar -xvf bladebit-cuda-v3.*.tar.gz
rm -f *tar.gz
chmod 755 bladebit*
chown root.root ./bladebit*

ln -s /opt/chia/bladebit/bladebit /usr/bin/bladebit
cd / && echo "Bladebit version: "`bladebit --version`
ln -s /opt/chia/bladebit/bladebit_cuda /usr/bin/bladebit_cuda
cd / && echo "Bladebit CUDA version: "`bladebit_cuda --version`
fi
fi
2 changes: 1 addition & 1 deletion scripts/config_api_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ ! -f "${API_SETTINGS_FILE}" ]; then
arch_name="$(uname -m)"
echo "Configuring API server for arch_name=${arch_name}"
if [ "${mode}" == "fullnode" ]; then
if [ "${arch_name}" = "aarch64" ]; then
if [ "${arch_name}" != "x86_64" ]; then
echo "STATUS_EVERY_X_MINUTES = 4" > ${API_SETTINGS_FILE}
else
echo "STATUS_EVERY_X_MINUTES = 2" > ${API_SETTINGS_FILE}
Expand Down
4 changes: 1 addition & 3 deletions scripts/forks/chia_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ else
if [[ "${arch_name}" = "x86_64" ]]; then
curl -sLJO https://github.com/Chia-Network/chia-blockchain/releases/download/2.1.1-rc1/chia-blockchain-cli_2.1.1rc1-1_amd64.deb
apt-get install ./chia-blockchain-cli*.deb
elif [[ "${arch_name}" = "arm64" ]]; then
else
curl -sLJO https://github.com/Chia-Network/chia-blockchain/releases/download/2.1.1-rc1/chia-blockchain-cli_2.1.1rc1-1_arm64.deb
apt-get install ./chia-blockchain-cli*.deb
else
echo "Installing Chia CUDA binaries skipped -> unsupported architecture: ${arch_name}"
fi
fi
2 changes: 1 addition & 1 deletion scripts/forks/chia_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ for p in ${plots_dir//:/ }; do
done

chmod 755 -R /root/.chia/mainnet/config/ssl/ &> /dev/null
chia init --fix-ssl-permissions
chia init --fix-ssl-permissions &> /dev/null

/usr/bin/bash /machinaris/scripts/gpu_drivers_setup.sh

Expand Down
34 changes: 15 additions & 19 deletions scripts/madmax_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,22 @@ CLASSIC_MADMAX_BRANCH=master
if [[ (${mode} =~ ^fullnode.* || ${mode} =~ "plotter") && (${blockchains} == 'chia' || ${blockchains} == 'chives') ]]; then
if [ ! -f /usr/bin/chia_plot ] && [[ "${madmax_skip_build}" != 'true' ]]; then
arch_name="$(uname -m)"
if [[ "${arch_name}" = "x86_64" ]] || [[ "${arch_name}" = "arm64" ]]; then
apt update && apt install -y libsodium-dev cmake g++ git build-essential
cd /
git clone --branch ${CLASSIC_MADMAX_BRANCH} https://github.com/madMAx43v3r/chia-plotter.git
cd chia-plotter && echo "Building madmax on ${arch_name}..."
if [[ -z "${madmax_relic_main}" ]]; then # Hack on 2021-11-29 due to failed builds on some systems...
sed -i 's/set(ENV{RELIC_MAIN} "1")/#set(ENV{RELIC_MAIN} "1")/g' CMakeLists.txt
fi
git submodule update --init
git checkout $HASH
./make_devel.sh
mkdir -p /usr/lib/chia-plotter
cp -r ./build/* /usr/lib/chia-plotter
ln -s /usr/lib/chia-plotter/chia_plot /usr/bin/chia_plot
ln -s /usr/lib/chia-plotter/chia_plot_k34 /usr/bin/chia_plot_k34
cd /
rm -rf chia-plotter
else
echo "Building madmax skipped -> unsupported architecture: ${arch_name}"
apt update && apt install -y libsodium-dev cmake g++ git build-essential
cd /
git clone --branch ${CLASSIC_MADMAX_BRANCH} https://github.com/madMAx43v3r/chia-plotter.git
cd chia-plotter && echo "Building madmax on ${arch_name}..."
if [[ -z "${madmax_relic_main}" ]]; then # Hack on 2021-11-29 due to failed builds on some systems...
sed -i 's/set(ENV{RELIC_MAIN} "1")/#set(ENV{RELIC_MAIN} "1")/g' CMakeLists.txt
fi
git submodule update --init
git checkout $HASH
./make_devel.sh
mkdir -p /usr/lib/chia-plotter
cp -r ./build/* /usr/lib/chia-plotter
ln -s /usr/lib/chia-plotter/chia_plot /usr/bin/chia_plot
ln -s /usr/lib/chia-plotter/chia_plot_k34 /usr/bin/chia_plot_k34
cd /
rm -rf chia-plotter
fi
fi

Expand Down

0 comments on commit e53026b

Please sign in to comment.