Hey all... I made a post on my photography website on how to install Stratum Mining Proxy on Raspberry Pi. For next year I want my website to only be my photography and video work so I am moving my posts to either a hosted wordpress account and here. So this is the post I made for running a mining proxy on a Raspberry Pi. Please forgive me if this is in the wrong place:
Honestly, when you have as many miners as I do sometimes setting them up gets annoying. Imagine having to setup 20 or more ASIC blades. Having your own stratum proxy not only makes setup easier but stratum improves pool performance. Advantages of stratum is:
No more messages like “pool is not providing work fast enough” in miners, because work is produced locally by the proxy
Extremely low stale rate (less than 0.1%, that means below 1 stale per 1000 accepted shares)
Very low network bandwidth usage (around 10kB/minute)
The best way to have your own proxy is to install it on a Raspberry Pi. They are inexpensive, low power and runs Linux. It doesn’t get any better than that. If you want more information about stratum read the great post on Slush’s website.
http://mining.bitcoin.cz/stratum-miningThe following tutorial is a modified version of Slush’s tutorial for the Raspberry Pi.
What you will need:
Raspberry Pi Model B
SD Card With Linux installed(I recommend Occidentalis)
http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/Case for Pi
Ethernet Cable
Power Cable
Putty or SSH Software
http://www.putty.org/Get the Raspberry Pi set up and running your OS. You can follow the tutorials at Adafruit.
Preparing an SD Card for your Raspberry Pi
http://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi/overview First Time Configuration
http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration/overviewEnable SSH
Enable SSHAlright, now its time to get to the meat of the tutorial. Open putty or ssh software and connect to your Pi. From here on its copy and paste. Pretty easy.
Lets start off with updating our Pi:
sudo apt-get update
This will download the files we need:
git clone git://github.com/slush0/stratum-mining-proxy.git
We now need to change to the directory where the files are located:
cd stratum-mining-proxy
Now time to download development packages for Python:
sudo apt-get install python-dev
We need to upgrade setuptools package:
sudo python distribute_setup.py
This package needs to have Twisted install. Problem is we need Twisted for the Pi. So, we need to change some files:
sudo nano setup.py
Find:
'install_requires': ['setuptools>=0.6c11', 'twisted>=12.2.0', 'stratum>=0.2.11', 'argparse'],
Change to:
'install_requires': ['setuptools>=0.6c11', 'stratum>=0.2.11', 'argparse'],
That will not install Twisted. You will not get an error saying you dont have enough space.
Now, we install Twisted for Pi.
sudo apt-get install python-twisted
Perfect, that should have installed twisted. We can now install the rest of the libraries:
sudo python setup.py develop
We are almost done. Time to install Screen. Screen allows us to continue running an SSH command even after we have disconnected.
sudo apt-get install screen
Lets start a Screen session. Its simple:
screen
Press Enter or Space to bring up the command line.
Lets get back into the directory:
cd stratum-mining-proxy
Last but not least lets run the script*:
./mining_proxy.py
That’s all. All you need to do is change your miner settings.
Point your miners to the Raspberry Pi ip address and port:
Example: 192.168.1.xx:8332
8332 is the default listen port.
*The script is for Slush’s pool. Not all of us mine his pool. If you need to change it its pretty simple. Instead of running:
./mining_proxy.py
Run:
./mining_proxy.py -o stratum.poolurl.com -p port -sp 3334 -gp 8332
Make sure you change “stratum.poolurl.com” to your pools URL and the port to the pool.
For example I am on Zetpool. I am using:
./mining_proxy.py -o us.stratum.zetpool.com -p 3333 -sp 3334 -gp 8332
To make it run at start up..
cd stratum-mining-proxy
Changes Directories
sudo nano miningserver.sh
Creates a file named miningserver.sh. This is where we type the command that we want to run at startup.
#!/bin/bash
node ./mining_proxy.py -o poolurl.com -p poolport -sp 3334 -gp getworkport
exec bash
The code runs the miningproxy at startup with the information for your pool... MAKE sure to change the dummy text with your pool info.
Then press
Ctrl x.
Then
Y
... Then
Enter
.
This will save the file and exit the text editor.
We are almost done.
Now time to tell the system to start that command at startup.
sudo nano /etc/rc.local
This is the boot file for linux. After
# By default this script does nothing.
and before
exit 0
.
Type..
cd stratum-mining-proxy
screen -dmS test ./miningserver.sh
Then press
ctrl-x.
Then
Y
, Then
Enter
.
Your pretty much done.
Type...
sudo reboot
this will reboot the pi. Wait a few mins. then try it out.
That’s all folks. If you have any problems let me know. I will do my best to help.