Skip to content

Instantly share code, notes, and snippets.

@xinaxu
Created March 29, 2024 17:39
Show Gist options
  • Save xinaxu/1b805a488028bacd158119d806654b91 to your computer and use it in GitHub Desktop.
Save xinaxu/1b805a488028bacd158119d806654b91 to your computer and use it in GitHub Desktop.
init-gpu.sh
#!/bin/bash
apt update
apt install -y expect unzip
wget https://github.com/h9-dev/spacemesh-miner/releases/download/v3.0.3/H9-Miner-spacemesh-v3.0.3-1-linux.zip
unzip *.zip
pushd linux
sed -i 's/disablePlot: true/disablePlot: false/' config.yaml
sed -i 's/#serverPort/serverPort/' config.yaml
cat > run.expect << 'EOF'
#!/usr/bin/expect
set timeout -1
spawn ./h9-miner-spacemesh-linux-amd64 -gpuServer
sleep 1
send -- "YES\r"
expect eof
EOF
chmod +x run.expect
nohup ./run.expect &> h9.log &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment