BitShares Forum

Other => Graveyard => BitShares PTS => Topic started by: derrend on March 09, 2014, 03:04:12 pm

Title: One Line of Code Setup, CPU Pool Mining Using DigitalOcean (VPS) Instructions.
Post by: derrend on March 09, 2014, 03:04:12 pm
IMPORTANT NOTES:
----------------
# If you do not have an address to send the coins you are mining to, you can download the clients from their respective websites if one is available or by cloning the directory tree from github and following the instructions which we are about to learn how to do below. You can even use google to look for an online wallet if one exists but you usually CANNOT send them directly to your trading wallets on trading sites such as 'https://www.cryptsy.com/ (https://www.cryptsy.com/)' Taken from cryptsy website --> "Notice: Do NOT use p2pool to deposit directly to your Cryptsy wallets, as it will not show the address in our wallet and we will be unable to credit your account."

# Signing up for multiple accounts using the same info is against their terms of service. If you do this you may have your account removed by DigitalOcean and lose access to any coins you've mined.

# I have tested this script on the "Ubuntu 12.04.3 x64" and "Ubuntu 13.10 x64" droplets without a problem so I suggest you use one of those.

# What this script will do:
# - Ultimately, it will configure a freshly instanciated droplet ready for CPU pool mining right out of the box regardless of size.
# - Prompt you to change the root password to something more memorable.
# - Prompt you to create a non-privileged user with sudo privileges and set a password for it.
# - Create a swap file and add it to your fstab for persistence over reboots.
# - Download and install all required software plus some extra functionality such as ability to download megalinks with "megatools" for example.
# - Download and compile a multi-threaded CPU pool miner compatible with the Litecoin, Bitcoin and Quarkcoin algorithms.
# - End with you logged in as the new non-privileged you created earlier located in the same folder as your compiled miner all ready for launch.

# Remember:
# - Digitalocean still charges for droplets even if they are switched off, they must be destroyed to avoid fees.
# - To save yourself having to rebuild droplets from scratch all the time, you should take a snapshot of an already setup droplet and just restore it whenever you need a new one.
# - Digitalocean dont charge for snapshots.

# If you would like to inspect the source code it is available here (http://pastebin.com/raw.php?i=dZHyqRY9)

INSTRUCTIONS:
-------------
# 01) Go to DigitalOcean (https://www.digitalocean.com/?refcode=9039094f0a5c) and sign up for an account. <-- Please use this link to earn me some credits for making this guide, better they go to someone rather than to waste  :)

# 02) Create an Ubuntu 13.10 x64 droplet with the size you want.

# 03) You will be emailed an IP address and password with instructions on how to SSH into your new instance.

# 04) Copy and paste this single line of code directly into the root terminal window as soon as you log into a new droplet and press [ENTER].
Code: [Select]
wget -O setup.sh http://pastebin.com/raw.php?i=dZHyqRY9 && sed 's/'"$(printf '\015')"'//g' setup.sh > setup.sh.tmp && mv setup.sh.tmp setup.sh && chmod +x setup.sh && ./setup.sh

# 05) Once the script has finished you should find an executable file name 'minerd' in your current directory, this is your CPU miner!

# 06) Find a mining pool of your choice using google. 'http://p2pool.org/ (http://p2pool.org/)' isn't bad. It's on sites like these that you can find settings for mining pools, usernames, passwords, IP addresses so you know where to point your miner, etc.

# 07) The syntax for the miner is this. (when you are located in the same directory as 'minerd' that is).
Code: [Select]
./minerd --url http://whatever.poolyouwant.com:Port/ --userpass USERNAME:password
# So to mine litecoins using the settings displayed on p2pool.org would be:
Code: [Select]
./minerd --url http://p2pool.org:9327/ --userpass <YOUR-LITECOIN-ADDRESS>:Anything
# You can also specify a particular number of processor cores to use with the '-t N' option where N is the number of cores you wish to dedicate, this may be useful if using your home computer to mine for example. Leaving out the '-t' option uses all available cores by default.
Code: [Select]
./minerd -t N --url http://whatever.poolyouwant.com:Port/ --userpass USERNAME:password

# All done. Good luck in your mining endeavours. If the first pool you try returns errors try connecting again or try your miner on a few more pools before concluding your miner is broken. I find errors on mining pools are sometimes not uncommon.

# Also be aware that mining for bitcoins with your CPU is not very efficient now that the difficulty level is so high so perhaps targeting a newer alternative coin or 'alt coins' as they are known and exchanging them for bitcoins once the value of that alt coin has increased might be a better strategy since the difficulty level on these should be considerably lower.