Vast.ai Hashtopolis Agent Setup Script
-
Title: hashtopolis agent setup script
Author: cyclone
URL:https://github.com/cyclone-github/scripts/blob/main/vastai_htp_setup.sh
Description:
Simple script to run on a vast.ai (or any debian linux) instance to get an agent connected to your hashtopolis server.#!/bin/bash # vast.ai htp setup script # by cyclone # # Changelog: # 2024-12-03.1845; # initial github release # 2024-12-04.0945; # added pciutils to update PCI IDs for htp to recognize newer GPUs # added sanity check to ensure script is run as root # updated comments for bash compatibility HTP_SERVER="https://htp_server.com" # EDIT your htp server ip / domain HTP_VOUCHER="htp_voucher" # EDIT your htp voucher (reusable voucher works best if setting up multiple agents) if [ "$EUID" -ne 0 ]; then echo "Script must be run as root. Please run again using sudo or as root user." exit 1 fi echo "This script will setup a new vast.ai instance to run htp." echo echo "Running apt update..." apt update &> /dev/null && echo "Ok" || echo "Failed" echo "Running apt dist-upgrade..." apt dist-upgrade -y &> /dev/null && echo "Ok" || echo "Failed" echo "Installing required software..." apt install wget nano python3 python3-requests python3-psutil pciutils -y &> /dev/null && echo "Ok" || { echo "Failed, exiting"; exit 1; } echo "Updating PCI IDs..." update-pciids &> /dev/null && echo "Ok" || echo "Failed" echo "Creating & entering htp directory..." mkdir htp &> /dev/null cd htp/ && echo "Ok" || { echo "Failed, exiting"; exit 1; } echo "Downloading hashtopolis.zip from htp server..." wget -O hashtopolis.zip "$HTP_SERVER/agents.php?download=1" &> /dev/null && echo "Ok" || { echo "Failed, exiting"; exit 1; } echo "Creating config.json..." echo '{ "url": "'"$HTP_SERVER"'/api/server.php", "voucher": "'"$HTP_VOUCHER"'", "token": "", "uuid": "" }' > config.json && echo "Ok" || { echo "Failed, exiting"; exit 1; } echo "Running htp python client..." python3 hashtopolis.zip && echo "Ok" || echo "Failed"
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login