Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: gigawatt on July 23, 2013, 02:37:31 PM



Title: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on July 23, 2013, 02:37:31 PM
After reading mikaelh's Primecoin setup guide (https://bitcointalk.org/index.php?topic=259022.0) I decided to automate as much of the process as possible to make it noob friendly.

The result is this!

Setting up a Primecoin Miner on VPS for Absolute Noobs
Donations welcome!
BTC: 1E2egHUcLDAmcxcqZqpL18TPLx9Xj1akcV
Ψ: AWHJbwoM67Ez12SHH4pH5DnJKPoMSdvLz2

Before You Begin
  • Download PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) (putty.exe) so you can connect to your VPS when the time comes.
  • Sign up for a DigitalOcean (http://goo.gl/62aGBQ) or Linode (http://goo.gl/bWFtiV) account.
    • During the creation process, be sure to create a node running Ubuntu 13.04 x64 (not x86)
  • If you signed up for DigitalOcean, check your email for your root password.  If you signed up for Linode, your password will be what you specified.
  • Run PuTTY and paste the node's IP address into the "Host Name" slot, then hit "Open" at the bottom. (figure 1) (https://i.imgur.com/TTmKrnd.png)
  • PuTTY will ask you to confirm the SSH key, press Yes (it will only ask once) (figure 2) (https://i.imgur.com/rZ1j1Dc.png)
  • Type or paste your password into PuTTY and press enter.  To paste, simply right click.
    • Note: You will not see the password characters!  This is normal.
http://goo.gl/62aGBQhttp://goo.gl/qMHVgJ

Getting Down to Business
  • If you chose DigitalOcean, it's time to change the root password!  Type passwd, press enter, then enter a new password.  Just like before, the password characters will not show up. (figure 3) (https://i.imgur.com/vsNlOBV.png)
  • Copy this automated setup script (http://pastebin.com/raw.php?i=T19PrHcf) to notepad. (highlighted version (http://pastebin.com/T19PrHcf))
  • At the top of the script, there are fields starting with "PRIMECOIN_".  Fill these out with your desired info.  Be sure to keep the quotes!
    • PRIMECOIN_USERNAME is your primecoind username.  It's required for primecoind to work properly!
    • PRIMECOIN_SIEVESIZE, PRIMECOIN_SIEVEPCT, PRIMECOIN_SIEVEEXTENSIONS are parameters used by mikaelh's high-performance primecoin (https://bitcointalk.org/index.php?topic=255782.0) client (see link for info)
  • Copy the entire modified script from notepad and paste it into your PuTTY window (right click), then hit enter.
  • The setup is now running.  It will take approximately 10 minutes to complete.
  • Once the script completes, you will see a brief help message and list of commands. (figure 4) (https://i.imgur.com/7ukU7q0.png)

Congratulations!  You're now mining for primecoins!
It may take a few minutes before you actually begin mining.  This is normal.  Primecoin needs to download the blockchain before it can begin doing work.  After it's caught up, you should be able to run ./peek and see that it's generating primes.

If you'd like to maximize your mining potential, please see my mini-guide on How to Clone DigitalOcean Droplets (https://bitcointalk.org/index.php?topic=284831.msg3045081#msg3045081).



What Now?
  • If you haven't already, download the latest version of the Primecoin client.
    • If you want to mine on your main computer, get mikaelh's client (https://bitcointalk.org/index.php?topic=255782.0)
    • If you just want to keep track of your coins, get the regular client (http://sourceforge.net/projects/primecoin/files/)
  • To "merge" your primecoin accounts into one, you'll need to gather the private keys from your VPS nodes
    • Log into your droplet like you did at the beginning of the setup.  This time your password will be what you set it to.
    • Run ./peek to verify that primecoind is running.  If it isn't, run ./start-primecoind and wait a few moments.
    • Run ./myinfo to dump your addresses and private keys values. (figure 5) (https://i.imgur.com/ip8X0no.png)
    • Copy the private key value (the random text after "PrivKey:") by highlighting it with your cursor.
    • On your main computer, open Primecoin and import the private key.
      • From the main Primecoin screen, click Help -> Debug Window
      • In the new popup, select Console
      • Type importprivkey YOUR_PRIVKEY SOME_LABEL and wait a few seconds.  YOUR_PRIVKEY is what you copied from PuTTY and SOME_LABEL is what you want the address to appear as in your address book. (figure 6) (https://i.imgur.com/cn3urrt.png)
      • Repeat this for as many private keys you wish to import.  Once finished, close and re-run the Primecoin client.  You should see the new addresses under "Receive".
    • Note: if an instance of primecoind mines a block, it may not be under the address you exported.  Wait for the block to be confirmed, then dump your addresses again.  Alternately, modify the notify-wallet script to FTP a backup of your wallet.dat file.
  • Occasionally you may wish to update your primecoin miner when new versions or patches are released.  To do this...
    • Log into your DigitalOcean droplet
    • Run ./stop-primecoind to stop the primecoind process
    • Run ./build-primecoin to update and rebuild primecoind
    • Run ./start-primecoind to start your primecoind process again
    • Wait a few minutes and run ./peek to make sure it's running correctly
  • If you'd like to remotely backup your wallet.dat file whenever you mint a new block, check this short guide (https://bitcointalk.org/index.php?topic=261179.msg2796507).

Changelog
  • 27 August, 2013
    • Cron reboot script now works properly.  (Damn you cron and your newlines!)
    • ~/peek no longer shows orphaned blocks.  Balance will only include transactions with one or more confirmations.
    • ~/myinfo now shows all addresses, not just those in the last ~100 transactions.  The pattern matching has been made more generic, so it works with just about any coin on main/testnet.  It also only does a lookup on addresses that generated a block or received currency.
    • PRIMECOIN_ROUNDSIEVEPERCENTAGE has been removed, replaced with PRIMECOIN_SIEVEEXTENSIONS
    • Now includes a ~/restart-primecoind script
  • 20 August, 2013
    • Tweaked apt-get package names to grab most compatible package for the given install setup
    • Package list now includes fail2ban by default for some semblance of security
    • Package list now includes nano as a text editor.  Why some installs don't come with this is beyond me.
    • Swapfile now persists after reboot.
    • Auto reboot on kernel panic
  • 15 August, 2013 - Now Amazon EC2 compliant and primecoin runs at startup.
  • 12 August, 2013
    • Updated default parameters to match the newer hp9 client (1mil / 10% / 70%)
    • Runs apt-get update before installing things
    • ~/start-primecoind should no longer accidentally kill itself
    • Initial package install includes bc so ~/peek correctly shows all balances
    • Fixed haveged not running after setup.  There's been some debate on the usefulness haveged, but until it's definitively proven to be harmful, it will remain.
    • Post-install help screen now uses absolute paths instead of relative
    • Minor formatting chagnes
  • 01 August, 2013
    • ./peek now includes the chains/day metric (still in development).  It also shows "Immature Balance" instead of "Unconfirmed" to more accurately match the Primecoin-Qt client.
    • ./myinfo now correctly dumps all keys, not just confirmed
    • ./notify-wallet now has example headings
    • Install includes HAVEGED for increased entropy pool (thank you blackboy)
  • 29 July, 2013 - Lots of new stuff!
    • Added option: PRIMECOIN_ROUNDSIEVEPCT
    • PRIMECOIN_USERNAME is now required (I'm an idiot), but PRIMECOIN_PASSWORD is auto-generated.
    • Installs newest version of GMP before starting
    • notify-wallet now includes example on how to FTP a wallet backup
    • peek now dumps averages of "primemeter" stats.  This method provides much more accurate results than a single getmininginfo.  See an example here (https://bitcointalk.org/index.php?topic=255782.msg2815382#msg2815382).
    • start-primecoind shouldn't kill itself anymore
  • 24 July, 2013
    • ./peek now shows confirmed/unconfirmed balance and pending "immature" transactions
    • ./config now reboots primecoind after config changes have been made
    • ./stop-primecoind now pauses after killing primecoind process to prevent running ./start-primecoind too early.  It will also force-kill primecoind if it's misbehaving.
    • When building primecoin, intermediate .tar.bz2 file is now removed
    • RPC username/password config removed.  They're not exactly "noob" features.
    • New Feature: run script when blockchain is updated or when wallet is updated.  By default it make a backup of wallet.dat whenever the wallet updates (usually from mining a block)
    • New Feature: whenever primecoind crashes, the time of crash is logged in ~/crash.log
  • 23 July, 2013
    • When updating primecoin, pull from SourceForge instead of bitbucket.

If you have any questions or comments, feel free to speak up.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: gigawatt on July 23, 2013, 02:44:16 PM
Reserved


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: apbyte on July 23, 2013, 02:45:54 PM
What is approximate amount of primecoins you can mine in a day by using 512MB/1core ?


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: cryptohunter on July 23, 2013, 02:52:14 PM
What is approximate amount of primecoins you can mine in a day by using 512MB/1core ?

0 or less.  In a week or month you may get some. However if you ran it for just 1 day i would predict zero coins.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: apbyte on July 23, 2013, 02:53:02 PM
What is approximate amount of primecoins you can mine in a day by using 512MB/1core ?

0 or less.  In a week or month you may get some. However if you ran it for just 1 day i would predict zero coins.

Then wat is the point in paying 5$ for this ? :D


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: gigawatt on July 23, 2013, 03:00:05 PM
What is approximate amount of primecoins you can mine in a day by using 512MB/1core ?

0 or less.  In a week or month you may get some. However if you ran it for just 1 day i would predict zero coins.

Per day, you're probably technically correct.  Then again, your statement also applies to just about any non-cluster setup.




Then wat is the point in paying 5$ for this ? :D

With the way DigitalOcean works, you pay by the hour regardless of what configuration you've selected.
What that means is that you can run one 512mb/1core for a month or you can run four of them for a week.

You can have up to five droplets per account, but you can open a ticket to raise the cap.
Using the setup script, I managed to get a handful of droplets running in under 30 minutes and can update them with a single command.



Worst case scenario, I'm out $5.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: mikaelh on July 23, 2013, 03:17:38 PM
Nice initiative. However, I would prefer that people wouldn't post instructions that automatically clone the git repository. Those instructions already probably got my github repo disabled. It puts quite a lot of load on the repository hosting service too.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: achillez on July 23, 2013, 03:39:51 PM
something the OP didn't mention.. VPS's / DigitalOCean / Others are no longer profitable at difficulty 9.2+.  The days of renting online servers to make XPM are over... unless you like to lose $.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: gigawatt on July 23, 2013, 03:50:30 PM
Nice initiative. However, I would prefer that people wouldn't post instructions that automatically clone the git repository.

Good catch.  I've modified the script so that it only clones once and uses git pull to catch up.
The initial pull will be ~15MB, but after that just a few KB.  Much lighter and quicker than ~15MB each time.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: mikaelh on July 23, 2013, 04:02:20 PM
Nice initiative. However, I would prefer that people wouldn't post instructions that automatically clone the git repository.

Good catch.  I've modified the script so that it only clones once and uses git pull to catch up.
The initial pull will be ~15MB, but after that just a few KB.  Much lighter and quicker than ~15MB each time.

I would still prefer you didn't clone it at all. SourceForge has tons of mirrors which can handle load much more effectively.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: tadakaluri on July 23, 2013, 04:16:45 PM
Good Guide


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: gigawatt on July 23, 2013, 05:11:41 PM
Good catch.  I've modified the script so that it only clones once and uses git pull to catch up.
The initial pull will be ~15MB, but after that just a few KB.  Much lighter and quicker than ~15MB each time.

I would still prefer you didn't clone it at all. SourceForge has tons of mirrors which can handle load much more effectively.

My concern with that is that the path of the newest release can change without notice.

I don't want to put your bitbucket account in jeopardy though.  I'll start working on a way to dynamically pull from SourceForge, regardless of how hackish it turns out.  Once it's finished and tested, I'll update the setup script.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script
Post by: gigawatt on July 23, 2013, 09:50:05 PM
The script has been updated. (http://pastebin.com/T19PrHcf)

Here's the relevant section:
Code:
echo "Downloading and building primecoin..."
cat << "SCRIPT" > ~/build-primecoin
#!/bin/bash
[[ -f ~/stop-primecoind ]] && ./stop-primecoind
rm ~/primecoin*.tar.bz2
rm -rf ~/primecoin*
wget http://sourceforge.net/projects/primecoin-hp/files/latest/download -O ~/primecoin.tar.bz2
tar xjvf ~/primecoin.tar.bz2
cd ~/primecoin*/src
sed -i -e 's/$(OPENSSL_INCLUDE_PATH))/$(OPENSSL_INCLUDE_PATH) \/usr\/local\/include)/' makefile.unix
sed -i -e 's/$(OPENSSL_LIB_PATH))/$(OPENSSL_LIB_PATH) \/usr\/local\/lib)/' makefile.unix
sed -i -e 's/$(LDHARDENING) $(LDFLAGS)/$(LDHARDENING) -Wl,-rpath,\/usr\/local\/lib $(LDFLAGS)/' makefile.unix
make -f makefile.unix USE_UPNP=-
sudo cp primecoind /usr/local/bin/
cd
SCRIPT
chmod +x ~/build-primecoin
~/build-primecoin

It will automatically download and compile the newest version of primecoin-hp from SourceForge (as to not overload git).


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on July 24, 2013, 06:20:09 PM
24 July, 2013 - Major updates!  See main post (https://bitcointalk.org/index.php?topic=261179.0) for additional info.


If you'd like to remotely backup your wallet.dat modify the following segment of code...
Code:
cat << "SCRIPT" > ~/notify-wallet
#!/bin/bash
# YOUR SCRIPT HERE

so that it does something like...

Code:
cat << "SCRIPT" > ~/notify-wallet
#!/bin/bash
cp ~/.primecoin/wallet.dat ~/${HOSTNAME}.bak
curl -T ~/${HOSTNAME}.bak ftp://your_remote_location --user your_ftpusername:your_ftppassword
SCRIPT

The script triggers based on primecoind's -walletnotify="~/notify-wallet" flag.  It should trigger whenever the wallet file changes, which includes when a new block is minted.


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script (Updated)
Post by: Pentel on July 27, 2013, 01:40:43 PM
It's asking me to set:
rpcpassword=<password> in the configuration file.

When I started it up.
How do I set a password??


Title: Re: [XPM] Noobproof Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on July 29, 2013, 04:38:50 PM
It's asking me to set:
rpcpassword=<password> in the configuration file.

When I started it up.
How do I set a password??


That was a mistake on my behalf.  I've updated the script, so please try it again.  Sorry for the hassle.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: lamiomni on July 30, 2013, 10:57:30 PM
For Amazon EC2 instances, you may be considering sudo for the apt-get and the cp commands and maybe more, since you are not root on them.

Code:
echo "Installing libraries..."
apt-get install build-essential curl git libboost-all-dev libdb++5.3-dev libdb5.3++-dev libminiupnpc-dev libssl-dev m4 -y

Code:
echo "Installing libraries..."
sudo apt-get install build-essential curl git libboost-all-dev libdb++5.3-dev libdb5.3++-dev libminiupnpc-dev libssl-dev m4 -y



Code:
cp primecoind /usr/local/bin/

Code:
sudo cp primecoind /usr/local/bin/


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on July 31, 2013, 04:05:38 AM
For Amazon EC2 instances, you may be considering sudo for the apt-get and the cp commands and maybe more, since you are not root on them.

Absolutely true.  On the Linode/DigitalOcean boxes, you are root.

I'm wondering if the install would work if you 1) saved it as a shell script and 2) ran the script with sudo.  Most of it should work, but I'm not sure if primecoin would drop the config files where they should be.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: lamiomni on August 01, 2013, 04:14:17 PM
Didn't try, the script is almost working out-of-the-box, you also need to "sudo make install" for gmp.

FYI, XPM priming (hp8, Ubuntu Server 13.04 64 bit) on Amazon EC2 with High-CPU On-Demand Instances:
- Medium (1.7 GiB of memory, 5 EC2 Compute Units): ~1,1kPPS
- Extra Large (7 GiB of memory, 20 EC2 Compute Units): ~4.5kPPS

I'm trying to tune the parameters a bit to find optimal settings.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 01, 2013, 05:08:00 PM
Didn't try, the script is almost working out-of-the-box, you also need to "sudo make install" for gmp.

FYI, XPM priming (hp8, Ubuntu Server 13.04 64 bit) on Amazon EC2 with High-CPU On-Demand Instances:
- Medium (1.7 GiB of memory, 5 EC2 Compute Units): ~1,1kPPS
- Extra Large (7 GiB of memory, 20 EC2 Compute Units): ~4.5kPPS

I think that also may apply to the apt-get commands too.


I'd recommend running benchmarks on a few different parameter setups, you'd be surprised what kind of performance you can get.
On a 1 CPU (2.4GHz) DigitalOcean droplet, I can manage ~120 5-chain/hr or about ~1k PPS with optimized parameters.

Assuming that keep your debug.log file relatively clean (echo "" > ~/.primecoin/debug.log before you start), you can use this to calculate your running averages:
Code:
grep primemeter ~/.primecoin/debug.log | awk '{s1+=$4;s2+=$6;s3+=$8} END {printf"%10s: %10d\n%10s: %10d\n%10s: %10d\n","Prime/h",s1/NR,"Test/h",s2/NR,"5-Chain/h",s3/NR}'



Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: lamiomni on August 01, 2013, 05:43:55 PM
Which settings are you using for a 1-CPU droplet @DigitalOcean?

Basic settings, on extra large instance (sieve size 1M, sieve percentage 10, round sieve size 30): 4.5k PPS, 550 5-chains/h

Current best tweaked settings (so far), on extra large instance (sieve size 250k, sieve percentage 3, round sieve size 45): 5.7k PPS, 840 5-chains/h

Looking for best 5-chains/h

Lower sieve sizes are better, on extra large instance (sieve percentage 10, round sieve size 30):
- 100k: 6.6k PPS, 660 5-chains/h
- 250k: 5.6k PPS, 650 5-chains/h
- 500k: 4.9k PPS, 650 5-chains/h
- 900k: 4.6k PPS, 600 5-chains/h
- 1.1M: 4.4k PPS, 540 5-chains/h

Lower sieve percentages are better, on extra large instance (sieve size 1M, round sieve size 30):
- 1: 7.1k PPS, 640 5-chains/h
- 2: 6.5k PPS, 600 5-chains/h
- 3: 5.6k PPS, 800 5-chains/h
- 4: 5.2k PPS, 670 5-chains/h
- 5: 5.1k PPS, 610 5-chains/h
- 15: 3.7k PPS, 510 5-chains/h

Higher round sieve sizes are better, on extra large instance (sieve size 1M, sieve percentage 10):
- 20: 4.1k PPS, 440 5-chains/h
- 25: 4.5k PPS, 550 5-chains/h
- 35: 4.4k PPS, 660 5-chains/h
- 40: 4.2k PPS, 730 5-chains/h
- 42: 4.1k PPS, 740 5-chains/h
- 45: 4.0k PPS, 735 5-chains/h
- 50: 3.8k PPS, 500 5-chains/h


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Pentel on August 02, 2013, 06:12:36 PM
I still get error's but I think it's working:
Pic Here. (https://i.imgur.com/lkIexLy.png)

It my be working but ./myinfo does not work.  
Error:
error: incorrect rpcuser or rpcpassword (authorization failed)


I wiped everything and started again, but with errors again.
See Pic (https://i.imgur.com/ggnsJSk.png)
 God damn wrong OS!!!  

It works now.  Thanks  ::)


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 02, 2013, 08:55:35 PM
Another round of updates!



Pic Here. (https://i.imgur.com/lkIexLy.png)
error: incorrect rpcuser or rpcpassword (authorization failed)

Usually that error is from editing your primecoin.conf file before stopping primecoin.
I've tweaked the ~/stop-primecoind script so it force kills it if it doesn't shutdown gracefully on it's own.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 04, 2013, 03:41:11 AM
Wow, I just shot myself in the foot today.

I set up a new node to test out a ./notify-block script.
I had it enabled right from the beginning, but about 20 minutes in things were going really really slow.

Turns out that when primecoin was downloading the blockchain, it triggered the notification script about 90,000 times.  Oops.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Dumbo on August 08, 2013, 12:06:53 PM
Please do not rip me apart, I am one of those complete noobs this guide was written for. I have started mining on a DigitalOcean Droplet. The primepersec is 528 (just in case anyone is wondering)

I have a few questions -

1. Using your tutorial on merging the primecoin accounts. I can open 3 other droplets, follow the same instruction to setup Primecoind and merge the - right?


2. The ypool droplet - do I have to keep the putty open? I saw someone complaining that they cannot mine as soon as they close the putty.

3. Amazon EC2 instances are the same thing as Digital Ocean Droplets right? will this work there too? I found this one some forum.. http://aws.amazon.com/big-data/powerof60/terms/  and was planning to use it.

4. If I signup for Linode , I would like to have a gigawatt's referral address. Since you took the time for us noobs, you deserve it.

Edit: I just noticed that his links are already referral links and that is totally fine by me. You deserve it sir!

Edit2: the command ./myinfo doesn't seem to work.
https://i.imgur.com/dFBXPSR.png


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 08, 2013, 03:04:57 PM
Please do not rip me apart, I am one of those complete noobs this guide was written for. I have started mining on a DigitalOcean Droplet. The primepersec is 528 (just in case anyone is wondering)

I have a few questions -

1. Using your tutorial on merging the primecoin accounts. I can open 3 other droplets, follow the same instruction to setup Primecoind and merge the - right?


2. The ypool droplet - do I have to keep the putty open? I saw someone complaining that they cannot mine as soon as they close the putty.

3. Amazon EC2 instances are the same thing as Digital Ocean Droplets right? will this work there too? I found this one some forum.. http://aws.amazon.com/big-data/powerof60/terms/  and was planning to use it.

4. If I signup for Linode , I would like to have a gigawatt's referral address. Since you took the time for us noobs, you deserve it.

Edit: I just noticed that his links are already referral links and that is totally fine by me. You deserve it sir!

Edit2: the command ./myinfo doesn't seem to work.

Thanks for enjoying the guide!  I'll do what I can to help:

  • Yes, that's correct.  I would recommend a different approach though.  1) Make one node, get it running and updated.  2) Shutdown the node and take a snapshot of the node.  3) Create a new node based on the snapshot.  That way all the cloned nodes will have the same wallet files and should stay in sync up to ~100 mined blocks.
  • For the ypool one: no, you shouldn't have to.  I have the script setup to run in the background, but the catch is that you can't "see" it work.  You can only verify that it is doing work, not necessarily what it's accomplished so far.  If you have doubts, run the start command in one session, connect with another PuTTY session, then check ps aux | grep miner.
  • Yes/no.  They're similar, but as others have noted, Amazon EC2 instances require using sudo commands in certain places.  If I recall correctly, it should be for each apt-get call.  (So change apt-get install blahblah to sudo apt-get install blahblah)
  • I personally prefer Linode as well.  $20 gets you an 8-core system vs $5 for a 1-core.  The only drawback I've noted is that Linode doesn't let you "clone" nodes very easily, so you'll have to run the setup for each node.
  • As for ./myinfo: it only dumps the addresses that have a transaction associated with them.  Transactions also include minting a block.

If you start having a handful of nodes to manage, I would recommend downloading multi-tabbed PuTTY (http://ttyplus.com/multi-tabbed-putty/).  It'll let you opened tabbed session for each VPS and send commands to all of them at once.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Dumbo on August 08, 2013, 03:27:05 PM
So..I have to wait a bit before I can merge the accounts and get private keys from  ./myinfo. Till a block is minted..right?

I just got got into bitcoins and cryptocurrencies, this is the first time I am mining (any cryptocurrency).


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 08, 2013, 03:50:37 PM
So..I have to wait a bit before I can merge the accounts and get private keys from  ./myinfo. Till a block is minted..right?

I just got got into bitcoins and cryptocurrencies, this is the first time I am mining (any cryptocurrency).


Correct.

Alternately, you can make a master wallet file on your computer, then copy it to each of the nodes.  That way, you and all your nodes have the same wallets and you don't have to go fish addresses out of the nodes.  If you go this route, be sure to stop primecoin, copy the wallet, then restart primecoin.

You can use WinSCP to transfer files to/from your nodes.  Your login info will be the same as your PuTTY info.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Dumbo on August 08, 2013, 03:55:24 PM
Thanks! I will give it a try


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Dumbo on August 08, 2013, 08:14:20 PM
Correct.

Alternately, you can make a master wallet file on your computer, then copy it to each of the nodes.  That way, you and all your nodes have the same wallets and you don't have to go fish addresses out of the nodes.  If you go this route, be sure to stop primecoin, copy the wallet, then restart primecoin.

You can use WinSCP to transfer files to/from your nodes.  Your login info will be the same as your PuTTY info.

Before I do something extremely stupid..

This is what I am doing.

1. From the regular primecoin client on my pc , I did Files>Backup Wallet and got the wallet.dat file
2. Then I used that wallet.dat file to replace .primecoin/wallet.dat file in the VPS using the ftp client.


That is what you meant right? Sorry for too many questions


Btw...if I have just cloned a droplet 3 more times, all 4 droplets have the same wallet.dat. Can I not just grab one of those wallet.dat files to Primecoin client on my PC?


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 09, 2013, 05:09:07 PM
Correct.

Alternately, you can make a master wallet file on your computer, then copy it to each of the nodes.  That way, you and all your nodes have the same wallets and you don't have to go fish addresses out of the nodes.  If you go this route, be sure to stop primecoin, copy the wallet, then restart primecoin.

You can use WinSCP to transfer files to/from your nodes.  Your login info will be the same as your PuTTY info.

Before I do something extremely stupid..

This is what I am doing.

1. From the regular primecoin client on my pc , I did Files>Backup Wallet and got the wallet.dat file
2. Then I used that wallet.dat file to replace .primecoin/wallet.dat file in the VPS using the ftp client.


That is what you meant right? Sorry for too many questions


Btw...if I have just cloned a droplet 3 more times, all 4 droplets have the same wallet.dat. Can I not just grab one of those wallet.dat files to Primecoin client on my PC?

You are correct on all counts.  As long as all the nodes (including yourself) have the same wallet.dat file, they should stay in sync up to ~100 mined blocks.

I'd also recommend that you restart the haveged service.  I noticed that it doesn't always run automatically after installation.  You can accomplish this with:
Code:
service haveged restart
You can verify it's running with
Code:
ps aux | grep -v grep | grep haveged


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Qantaqa on August 10, 2013, 08:24:24 AM
I noticed the script still sets roundsievepercentage to 30 while hp9's default changed to 70, any specific reason for this, or can i just update this?


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 12, 2013, 04:53:12 PM
I noticed the script still sets roundsievepercentage to 30 while hp9's default changed to 70, any specific reason for this, or can i just update this?

It's fixed now.  HP9 came out after my last update.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 12, 2013, 05:50:09 PM
Another tiny update.

The script now runs apt-get update before installing packages.  This makes it work better with RamNode.
The start and stop scripts now use [[ -n "$(pidof primecoind)" ]] to check if primecoind is running.  It should no longer kill itself on accident.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: nfuse on August 13, 2013, 11:19:30 AM
Thanks man for your work, even a noob like me got it working ;)


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 15, 2013, 08:16:12 PM
Good news!  I've updated the script and now it works on Amazon EC2 instances.
Furthermore, primecoin launches as soon as the server reboots, so you'll always have it running.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 16, 2013, 06:04:53 PM
Another minor update.  I've noticed that some hosting providers (DigitalOcean) occasionally result in a Kernel Panic on boot.

I've modified the script to auto-reboot in case of a kernel panic so mining can continue as usual.
Secondly, the swapfile will only build one time (it'll skip it if it detects a swapfile).

Updates are now as simple as re-running the whole script.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 20, 2013, 03:01:54 PM
More compatibility tweaks and a few stability tweaks.

fail2ban included by default to prevent brute-forcing an SSH login.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Pentel on August 24, 2013, 12:57:26 PM
I'm trying to import my private keys to my my client, but I keep getting this error
Error adding key to wallet (code -4)

I've tried putting my label within quotes but still no good.

EDIT: Found a solution here:
http://www.primecoiner.com/error-adding-key-to-wallet-code-4/


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 24, 2013, 05:56:00 PM
I'm trying to import my private keys to my my client, but I keep getting this error
Error adding key to wallet (code -4)

I've tried putting my label within quotes but still no good.

EDIT: Found a solution here:
http://www.primecoiner.com/error-adding-key-to-wallet-code-4/

Usually that's one of two things: 1) your wallet is encrypted and you haven't unlocked it or 2) that key exists in your wallet, but just isn't on your "addresses" screen.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: superresistant on August 25, 2013, 06:37:12 AM
Hello,

The command ./myinfo doesn't work for me even though all the rest seems to work.
Is there an other way to get my privatekey ?
Otherwise, how do I send coins ?

Thx

EDIT : Anyway... the ./myinfo is not working but I found an alternative : quarkcoind dumpprivkey "the adress"


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Pentel on August 25, 2013, 11:11:26 AM
I have imported my private key however my coins have not yet appeared.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on August 27, 2013, 07:39:53 PM
Lots of minor tweaks!  Many small bugs quashed!
See main post for details.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: soulmann on September 16, 2013, 11:27:45 PM
Is it possible to mine with pool? For example with http://ypool.net?

Thank you.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: gigawatt on September 17, 2013, 03:11:25 PM
Is it possible to mine with pool? For example with http://ypool.net?

Thank you.

Yep, I even have a short guide on the matter: https://bitcointalk.org/index.php?topic=265453.msg2840821#msg2840821
It doesn't work too well though.  Most of the mining scripts for primecoin were designed to run on windows.


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: afr33sl4ve on November 28, 2013, 04:07:34 PM
gigawatt,

I followed your tutorial to the T and I could not get any of my miners to pull an address.

Is PRIMECOIN_USERNAME supposed to be unique per miner?


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: afr33sl4ve on November 29, 2013, 05:08:57 PM
A thousand apologies for the double post, however, I need help with this:

Code:
Averages:
awk: cmd. line:1: {s1+=$4;s2+=$6;s3+=$8;s4+=$10} END {printf"%10s: %10d\n%10s: %10d\n%10s: %10d\n%10s: %10.5f
awk: cmd. line:1:                                           ^ unterminated string
awk: cmd. line:1: {s1+=$4;s2+=$6;s3+=$8;s4+=$10} END {printf"%10s: %10d\n%10s: %10d\n%10s: %10d\n%10s: %10.5f
awk: cmd. line:1:                                           ^ syntax error


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: AnhBen on December 28, 2013, 05:59:49 PM
After reading mikaelh's Primecoin setup guide (https://bitcointalk.org/index.php?topic=259022.0) I decided to automate as much of the process as possible to make it noob friendly.

The result is this!

Setting up a Primecoin Miner on VPS for Absolute Noobs
Donations welcome!
BTC: 1E2egHUcLDAmcxcqZqpL18TPLx9Xj1akcV
Ψ: AWHJbwoM67Ez12SHH4pH5DnJKPoMSdvLz2

Before You Begin
  • Download PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) (putty.exe) so you can connect to your VPS when the time comes.
  • Sign up for a DigitalOcean (https://www.digitalocean.com/?refcode=dbe99a6e91ee) or Linode (http://www.linode.com/?r=02323a0949ca9d51f753e28f944693aa08e84269) account.
    • During the creation process, be sure to create a node running Ubuntu 13.04 x64 (not x86)
  • If you signed up for DigitalOcean, check your email for your root password.  If you signed up for Linode, your password will be what you specified.
  • Run PuTTY and paste the node's IP address into the "Host Name" slot, then hit "Open" at the bottom. (figure 1) (https://i.imgur.com/TTmKrnd.png)
  • PuTTY will ask you to confirm the SSH key, press Yes (it will only ask once) (figure 2) (https://i.imgur.com/rZ1j1Dc.png)
  • Type or paste your password into PuTTY and press enter.  To paste, simply right click.
    • Note: You will not see the password characters!  This is normal.
https://www.digitalocean.com/?refcode=dbe99a6e91ee

Getting Down to Business
  • If you chose DigitalOcean, it's time to change the root password!  Type passwd, press enter, then enter a new password.  Just like before, the password characters will not show up. (figure 3) (https://i.imgur.com/vsNlOBV.png)
  • Copy this automated setup script (http://pastebin.com/raw.php?i=T19PrHcf) to notepad. (highlighted version (http://pastebin.com/T19PrHcf))
  • At the top of the script, there are fields starting with "PRIMECOIN_".  Fill these out with your desired info.  Be sure to keep the quotes!
    • PRIMECOIN_USERNAME is your primecoind username.  It's required for primecoind to work properly!
    • PRIMECOIN_SIEVESIZE, PRIMECOIN_SIEVEPCT, PRIMECOIN_SIEVEEXTENSIONS are parameters used by mikaelh's high-performance primecoin (https://bitcointalk.org/index.php?topic=255782.0) client (see link for info)
  • Copy the entire modified script from notepad and paste it into your PuTTY window (right click), then hit enter.
  • The setup is now running.  It will take approximately 10 minutes to complete.
  • Once the script completes, you will see a brief help message and list of commands. (figure 4) (https://i.imgur.com/7ukU7q0.png)

Congratulations!  You're now mining for primecoins!
It may take a few minutes before you actually begin mining.  This is normal.  Primecoin needs to download the blockchain before it can begin doing work.  After it's caught up, you should be able to run ./peek and see that it's generating primes.

If you'd like to maximize your mining potential, please see my mini-guide on How to Clone DigitalOcean Droplets (https://bitcointalk.org/index.php?topic=284831.msg3045081#msg3045081).



What Now?
  • If you haven't already, download the latest version of the Primecoin client.
    • If you want to mine on your main computer, get mikaelh's client (https://bitcointalk.org/index.php?topic=255782.0)
    • If you just want to keep track of your coins, get the regular client (http://sourceforge.net/projects/primecoin/files/)
  • To "merge" your primecoin accounts into one, you'll need to gather the private keys from your VPS nodes
    • Log into your droplet like you did at the beginning of the setup.  This time your password will be what you set it to.
    • Run ./peek to verify that primecoind is running.  If it isn't, run ./start-primecoind and wait a few moments.
    • Run ./myinfo to dump your addresses and private keys values. (figure 5) (https://i.imgur.com/ip8X0no.png)
    • Copy the private key value (the random text after "PrivKey:") by highlighting it with your cursor.
    • On your main computer, open Primecoin and import the private key.
      • From the main Primecoin screen, click Help -> Debug Window
      • In the new popup, select Console
      • Type importprivkey YOUR_PRIVKEY SOME_LABEL and wait a few seconds.  YOUR_PRIVKEY is what you copied from PuTTY and SOME_LABEL is what you want the address to appear as in your address book. (figure 6) (https://i.imgur.com/cn3urrt.png)
      • Repeat this for as many private keys you wish to import.  Once finished, close and re-run the Primecoin client.  You should see the new addresses under "Receive".
    • Note: if an instance of primecoind mines a block, it may not be under the address you exported.  Wait for the block to be confirmed, then dump your addresses again.  Alternately, modify the notify-wallet script to FTP a backup of your wallet.dat file.
  • Occasionally you may wish to update your primecoin miner when new versions or patches are released.  To do this...
    • Log into your DigitalOcean droplet
    • Run ./stop-primecoind to stop the primecoind process
    • Run ./build-primecoin to update and rebuild primecoind
    • Run ./start-primecoind to start your primecoind process again
    • Wait a few minutes and run ./peek to make sure it's running correctly
  • If you'd like to remotely backup your wallet.dat file whenever you mint a new block, check this short guide (https://bitcointalk.org/index.php?topic=261179.msg2796507).

Changelog
  • 27 August, 2013
    • Cron reboot script now works properly.  (Damn you cron and your newlines!)
    • ~/peek no longer shows orphaned blocks.  Balance will only include transactions with one or more confirmations.
    • ~/myinfo now shows all addresses, not just those in the last ~100 transactions.  The pattern matching has been made more generic, so it works with just about any coin on main/testnet.  It also only does a lookup on addresses that generated a block or received currency.
    • PRIMECOIN_ROUNDSIEVEPERCENTAGE has been removed, replaced with PRIMECOIN_SIEVEEXTENSIONS
    • Now includes a ~/restart-primecoind script
  • 20 August, 2013
    • Tweaked apt-get package names to grab most compatible package for the given install setup
    • Package list now includes fail2ban by default for some semblance of security
    • Package list now includes nano as a text editor.  Why some installs don't come with this is beyond me.
    • Swapfile now persists after reboot.
    • Auto reboot on kernel panic
  • 15 August, 2013 - Now Amazon EC2 compliant and primecoin runs at startup.
  • 12 August, 2013
    • Updated default parameters to match the newer hp9 client (1mil / 10% / 70%)
    • Runs apt-get update before installing things
    • ~/start-primecoind should no longer accidentally kill itself
    • Initial package install includes bc so ~/peek correctly shows all balances
    • Fixed haveged not running after setup.  There's been some debate on the usefulness haveged, but until it's definitively proven to be harmful, it will remain.
    • Post-install help screen now uses absolute paths instead of relative
    • Minor formatting chagnes
  • 01 August, 2013
    • ./peek now includes the chains/day metric (still in development).  It also shows "Immature Balance" instead of "Unconfirmed" to more accurately match the Primecoin-Qt client.
    • ./myinfo now correctly dumps all keys, not just confirmed
    • ./notify-wallet now has example headings
    • Install includes HAVEGED for increased entropy pool (thank you blackboy)
  • 29 July, 2013 - Lots of new stuff!
    • Added option: PRIMECOIN_ROUNDSIEVEPCT
    • PRIMECOIN_USERNAME is now required (I'm an idiot), but PRIMECOIN_PASSWORD is auto-generated.
    • Installs newest version of GMP before starting
    • notify-wallet now includes example on how to FTP a wallet backup
    • peek now dumps averages of "primemeter" stats.  This method provides much more accurate results than a single getmininginfo.  See an example here (https://bitcointalk.org/index.php?topic=255782.msg2815382#msg2815382).
    • start-primecoind shouldn't kill itself anymore
  • 24 July, 2013
    • ./peek now shows confirmed/unconfirmed balance and pending "immature" transactions
    • ./config now reboots primecoind after config changes have been made
    • ./stop-primecoind now pauses after killing primecoind process to prevent running ./start-primecoind too early.  It will also force-kill primecoind if it's misbehaving.
    • When building primecoin, intermediate .tar.bz2 file is now removed
    • RPC username/password config removed.  They're not exactly "noob" features.
    • New Feature: run script when blockchain is updated or when wallet is updated.  By default it make a backup of wallet.dat whenever the wallet updates (usually from mining a block)
    • New Feature: whenever primecoind crashes, the time of crash is logged in ~/crash.log
  • 23 July, 2013
    • When updating primecoin, pull from SourceForge instead of bitbucket.

If you have any questions or comments, feel free to speak up.

What's the standard PPS to at least solve a block so that we don't need more power and to instead running multiple instances?


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: AnhBen on December 28, 2013, 10:34:15 PM
Lots of minor tweaks!  Many small bugs quashed!
See main post for details.

I got better rate of PPS on Linode than the expensive DigitalOcean!


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: tautvilis on January 11, 2014, 10:02:17 PM
./myinfo doesnt work, it doesnt show anything


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: LiquidNitrogen on January 13, 2014, 07:15:30 PM
can anyone tell me how many primes/sec i should expect from each one of these services


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Jazek on January 14, 2014, 10:55:21 AM
./myinfo doesnt work for me too, and in DigitalOcean the primespersec that i get is 0-3 and the user usage is 46% i dont know wtf is going on, i followed your guide


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: AnhBen on January 17, 2014, 08:08:18 PM
Besides DO and Linode plus AWS EC2, what are other VPS that's affordable to mine XPM?


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: LiquidNitrogen on January 17, 2014, 08:36:42 PM
is there any way to figure the current profitability of these services?


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: Billyboy402 on January 22, 2014, 03:41:49 AM
sorry for the noob questions but i have just forward you donation for your hard work

Is this scrip mining for a pool or solo miner  ( what pool ) ? beeeer.org

What is the command to see the current primes and working ?

When you close putty , will it keep mining????
 like ( /etc/init.d/supervisor start ) from other mining on vps  http://techupdates.com/go/643377#


Title: Re: [XPM] Noobproof VPS Primecoin All-In-One EZ Setup Script (Updated)
Post by: BenAnh on March 11, 2014, 06:47:47 PM
How do you set it to send to your address/wallet automatically just in case a computer crashes or an instance gets terminated?