Post
Topic
Board Altcoin Discussion
Re: [XPM] Pool Mining Primecoin using DigitalOcean (VPS)
by
rethaw
on 29/11/2013, 03:53:42 UTC
Bonus points: turn it into a service that starts at boot so you can clone a bunch of droplets!

First, write a miner script:

Code:
cd ~
echo '
cd /root/primecoin/src
screen -d -m ./primeminer -poolip=54.200.248.75 -poolport=1337 -pooluser=Acrenf7WMZ3yFc7xkdbF8rGuuLw36Bkknr -poolpassword=PASSWORD -genproclimit=1' > startprime

chmod +x startprime

Now make the service that will keep it alive:

Code:
echo '
#!/bin/bash

until /root/startprime; do
  echo "Restarting miner">&2
  sleep 1
done' > primeservice
chmod +x primeservice

Now you can edit crontab to include this service to start at reboot. Type `crontab -e`, and in the last line of the file add:

Code:
@reboot   /root/primeservice

Now reboot the droplet with `sudo reboot`. When you've logged back in, check to see if it worked by sending `screen -r`. This should open the miner info.

You can then `sudo poweroff` the droplet and take a snapshot. This snapshot is then used when creating a new droplet!